users@jersey.java.net

RE: [Jersey] 400 Bad Request (bug?)

From: Jordi Domingo <noseya_at_hotmail.com>
Date: Tue, 22 Sep 2009 17:08:40 +0200

Hi again.
Im quite sure this is a bug. This happens when the param is a number, but never when it is a String.
Let's see what Jersey people say :)

Thanks
Jordi
From: noseya_at_hotmail.com
To: users_at_jersey.dev.java.net
Date: Tue, 22 Sep 2009 16:30:18 +0200
Subject: RE: [Jersey] 400 Bad Request (bug?)








Thanks for replying Herak.
The class is annotated:
@Path("/projects/{projectId: [0-9]{1,8}}/vulnerabilities")public class VulnerabilitiesResource{
..
@POST @Produces({"application/json"}) public Response post(@Context UriInfo uriInfo, @PathParam("projectId") int projectId, @FormParam("identifier") String identifier, @FormParam("usersId") Long usersId, @FormParam("statusId") Integer statusId, @FormParam("weaknessesId") Integer weaknessesId, @FormParam("name") String name, @FormParam("description") String description, @FormParam("consequences") String consequences, @FormParam("mitigations") String mitigations, @FormParam("cvssBase") java.math.BigDecimal cvssBase, @FormParam("cvssTemporal") java.math.BigDecimal cvssTemporal, @FormParam("cvssEnvironment") java.math.BigDecimal cvssEnvironment, @FormParam("standardProvidersCodesId") Long standardProvidersCodesId, @FormParam("visibility") String visibility, @FormParam("severity") Integer severity, @FormParam("difficulty") Integer difficulty, @FormParam("probability") Integer probability, @FormParam("risk") Integer risk) throws SystemException{...}

The same way like assets, assets works fine, this one no. Anything else to check?
Thanks,
Jordi
From: HSen_at_vertrax.com
To: users_at_jersey.dev.java.net
Date: Tue, 22 Sep 2009 10:12:54 -0400
Subject: RE: [Jersey] 400 Bad Request (bug?)



















Can you double check the path?

If ‘/project’ is the root resource then the ‘/vulnerabilities/new’
is the sub resource, therefore the method (‘post’) will need @Path(“{projectId}/vulnerabilities/new”)
annotation

 

Herak

 





From: Jordi Domingo
[mailto:noseya_at_hotmail.com]

Sent: Tuesday, September 22, 2009 8:57 AM

To: users_at_jersey.dev.java.net

Subject: RE: [Jersey] 400 Bad Request (bug?)





 

I
cant understand why its happening this.. in other places i make requests like
the one that fails and work fine



 







POST
/projects/1/assets HTTP/1.1





Host:
localhost





User-Agent:
Mozilla/5.0 (Windows; U; Windows NT 6.0; es-ES; rv:1.9.1.3) Gecko/20090824
Firefox/3.5.3 (.NET CLR 3.5.30729)





Accept:
application/json, text/javascript, */*





Accept-Language:
ca,en-us;q=0.7,it;q=0.3





Accept-Encoding:
gzip,deflate





Accept-Charset:
ISO-8859-1,utf-8;q=0.7,*;q=0.7





Keep-Alive:
300





Proxy-Connection:
keep-alive





Content-Type:
application/x-www-form-urlencoded; charset=UTF-8





X-Requested-With:
XMLHttpRequest





Referer:
http://localhost/projects/1/assets/new





Cookie:
JSESSIONID=1bb45c8173eba1145cf57e0ed37e





Pragma:
no-cache





Cache-Control:
no-cache





Content-Length:
31





 





environment=&url=&ip=&hostname=





 





Response
is 200 OK





 





My
Java method is declared this way (but the request didnt reach my code):







@POST





@Produces({"application/json"})





public
Response post(@Context UriInfo uriInfo, @PathParam("projectId") int
projectId, @FormParam("identifier") String identifier,





                                                          @FormParam("usersId")
Long usersId, @FormParam("statusId") Integer statusId,
@FormParam("weaknessesId") Integer weaknessesId,





                                                          @FormParam("name")
String name, @FormParam("description") String description,
@FormParam("consequences") String consequences,





                                                          @FormParam("mitigations")
String mitigations, @FormParam("cvssBase") java.math.BigDecimal
cvssBase,





                                                          @FormParam("cvssTemporal")
java.math.BigDecimal cvssTemporal, @FormParam("cvssEnvironment")
java.math.BigDecimal cvssEnvironment,





                                                          @FormParam("standardProvidersCodesId")
Long standardProvidersCodesId, @FormParam("visibility") String
visibility,





                                                         @FormParam("severity")
Integer severity, @FormParam("difficulty") Integer difficulty,
@FormParam("probability") Integer probability,





                                                          @FormParam("risk")
Integer risk) throws SystemException{





....





}





 





Any
help is appreciated.





 







From:
noseya_at_hotmail.com

To: users_at_jersey.dev.java.net

Date: Tue, 22 Sep 2009 13:50:08 +0200

Subject: [Jersey] 400 Bad Request (bug?)



Hi all :)



 





I'm
getting this error, and i think that is a bug. This is my request:





 









POST
/projects/1/vulnerabilities HTTP/1.1





Host:
localhost





User-Agent:
Mozilla/5.0 (Windows; U; Windows NT 6.0; es-ES; rv:1.9.1.3) Gecko/20090824
Firefox/3.5.3 (.NET CLR 3.5.30729)





Accept:
application/json, text/javascript, */*





Accept-Language:
ca,en-us;q=0.7,it;q=0.3





Accept-Encoding:
gzip,deflate





Accept-Charset:
ISO-8859-1,utf-8;q=0.7,*;q=0.7





Keep-Alive:
300





Proxy-Connection:
keep-alive





Content-Type:
application/x-www-form-urlencoded; charset=UTF-8





X-Requested-With:
XMLHttpRequest





Referer:
http://localhost/projects/1/vulnerabilities/new





Cookie:
JSESSIONID=16f95e59d3b1b0e954310c190c60





Content-Length:
161





 





identifier=identifier&usersId=1&statusId=1&weaknessesId=4&name=name&description=description&visibility=I&standardProvidersCodesId=&severity=2&difficulty=2&risk=1





 





THe
response is 400 Bad Request.





 





What
you see in bold is causing the bad request. Take it out and works fine.





 





Thanks,





 





Jordi







 







Charlas
más divertidas con el nuevo Windows Live
Messenger



 







Comparte
tus fotos con tus amigos. Más fácil con Windows Live

                                               
Diferentes formas de estar en contacto con amigos y familiares. Descúbrelas. Descúbrelas. _________________________________________________________________ Nuevo Windows Live, un mundo lleno de posibilidades. Descúbrelo. http://www.microsoft.com/windows/windowslive/default.aspx
--_1dcad023-c207-42dd-9e8c-faf32ead60b3_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi again.<div><br></div><div>Im quite sure this is a bug. This happens when the param is a number, but never when it is a String.</div><div><br></div><div>Let's see what Jersey people say :)<br><br></div><div>Thanks</div><div><br></div><div>Jordi<br><hr id="stopSpelling">From: noseya_at_hotmail.com<br>To: users_at_jersey.dev.java.net<br>Date: Tue, 22 Sep 2009 16:30:18 +0200<br>Subject: RE: [Jersey] 400 Bad Request (bug?)<br><br>



<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Verdana;}
</style>


Thanks for replying Herak.<div><br></div><div>The class is annotated:</div><div><br></div><div><div>@Path("/projects/{projectId: [0-9]{1,8}}/vulnerabilities")</div><div>public class VulnerabilitiesResource{</div><div><br></div><div>..</div><div><br></div><div><div>@POST</div><div><span class="ecxApple-tab-span" style="white-space:pre"> </span>@Produces({"application/json"})</div><div><span class="ecxApple-tab-span" style="white-space:pre"> </span>public Response post(@Context UriInfo uriInfo, @PathParam("projectId") int projectId, @FormParam("identifier") String identifier,&nbsp;</div><div><span class="ecxApple-tab-span" style="white-space:pre"> </span>@FormParam("usersId") Long usersId, @FormParam("statusId") Integer statusId, @FormParam("weaknessesId") Integer weaknessesId,&nbsp;</div><div><span class="ecxApple-tab-span" style="white-space:pre"> </span>@FormParam("name") String name, @FormParam("description") String description, @FormParam("consequences") String consequences,&nbsp;</div><div><span class="ecxApple-tab-span" style="white-space:pre"> </span>@FormParam("mitigations") String mitigations, @FormParam("cvssBase") java.math.BigDecimal cvssBase,&nbsp;</div><div><span class="ecxApple-tab-span" style="white-space:pre"> </span>@FormParam("cvssTemporal") java.math.BigDecimal cvssTemporal, @FormParam("cvssEnvironment") java.math.BigDecimal cvssEnvironment,&nbsp;</div><div><span class="ecxApple-tab-span" style="white-space:pre"> </span>@FormParam("standardProvidersCodesId") Long standardProvidersCodesId, @FormParam("visibility") String visibility,&nbsp;</div><div><span class="ecxApple-tab-span" style="white-space:pre"> </span>@FormParam("severity") Integer severity, @FormParam("difficulty") Integer difficulty, @FormParam("probability") Integer probability,&nbsp;</div><div><span class="ecxApple-tab-span" style="white-space:pre"> </span>@FormParam("risk") Integer risk) throws SystemException{</div><div>...</div><div>}</div><div><br></div><div><br></div><div>The same way like assets, assets works fine, this one no. Anything else to check?</div><div><br></div><div>Thanks,</div><div><br></div><div>Jordi</div></div><br><hr id="ecxstopSpelling">From: HSen_at_vertrax.com<br>To: users_at_jersey.dev.java.net<br>Date: Tue, 22 Sep 2009 10:12:54 -0400<br>Subject: RE: [Jersey] 400 Bad Request (bug?)<br><br>







<style>
.ExternalClass .ecxshape
{;}
</style>

<style>
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxapple-tab-span
{;}
.ExternalClass span.ecxEmailStyle19
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass .ecxMsoChpDefault
{font-size:10.0pt;}
@page Section1
{size:8.5in 11.0in;}
.ExternalClass div.ecxSection1
{page:Section1;}
</style>





<div class="ecxecxSection1">

<p class="ecxecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">Can&nbsp; you double check the path?</span></p>

<p class="ecxecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">If ‘/project’ is the root resource then the ‘/vulnerabilities/new’
is the sub resource, therefore the method (‘post’) will need @Path(“{projectId}/vulnerabilities/new”)
annotation</span></p>

<p class="ecxecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">&nbsp;</span></p>

<p class="ecxecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">Herak</span></p>

<p class="ecxecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">&nbsp;</span></p>

<div>

<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">

<p class="ecxecxMsoNormal"><b><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">From:</span></b><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> Jordi Domingo
[mailto:noseya_at_hotmail.com] <br>
<b>Sent:</b> Tuesday, September 22, 2009 8:57 AM<br>
<b>To:</b> users_at_jersey.dev.java.net<br>
<b>Subject:</b> RE: [Jersey] 400 Bad Request (bug?)</span></p>

</div>

</div>

<p class="ecxecxMsoNormal">&nbsp;</p>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">I
cant understand why its happening this.. in other places i make requests like
the one that fails and work fine</span></p>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">POST
/projects/1/assets HTTP/1.1</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Host:
localhost</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">User-Agent:
Mozilla/5.0 (Windows; U; Windows NT 6.0; es-ES; rv:1.9.1.3) Gecko/20090824
Firefox/3.5.3 (.NET CLR 3.5.30729)</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Accept:
application/json, text/javascript, */*</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Accept-Language:
ca,en-us;q=0.7,it;q=0.3</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Accept-Encoding:
gzip,deflate</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Accept-Charset:
ISO-8859-1,utf-8;q=0.7,*;q=0.7</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Keep-Alive:
300</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Proxy-Connection:
keep-alive</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Content-Type:
application/x-www-form-urlencoded; charset=UTF-8</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">X-Requested-With:
XMLHttpRequest</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Referer:
http://localhost/projects/1/assets/new</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Cookie:
JSESSIONID=1bb45c8173eba1145cf57e0ed37e</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Pragma:
no-cache</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Cache-Control:
no-cache</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Content-Length:
31</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">environment=&amp;url=&amp;ip=&amp;hostname=</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Response
is 200 OK</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">My
Java method is declared this way (but the request didnt reach my code):</span></p>

</div>

<div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">@POST</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">@Produces({"application/json"})</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">public
Response post(@Context UriInfo uriInfo, @PathParam("projectId") int
projectId, @FormParam("identifier") String identifier,&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span class="ecxecxapple-tab-span"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">@FormParam("usersId")
Long usersId, @FormParam("statusId") Integer statusId,
@FormParam("weaknessesId") Integer weaknessesId,&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span class="ecxecxapple-tab-span"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">@FormParam("name")
String name, @FormParam("description") String description,
@FormParam("consequences") String consequences,&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span class="ecxecxapple-tab-span"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">@FormParam("mitigations")
String mitigations, @FormParam("cvssBase") java.math.BigDecimal
cvssBase,&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span class="ecxecxapple-tab-span"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">@FormParam("cvssTemporal")
java.math.BigDecimal cvssTemporal, @FormParam("cvssEnvironment")
java.math.BigDecimal cvssEnvironment,&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span class="ecxecxapple-tab-span"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">@FormParam("standardProvidersCodesId")
Long standardProvidersCodesId, @FormParam("visibility") String
visibility,&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span class="ecxecxapple-tab-span"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">@FormParam("severity")
Integer severity, @FormParam("difficulty") Integer difficulty,
@FormParam("probability") Integer probability,&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span class="ecxecxapple-tab-span"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">@FormParam("risk")
Integer risk) throws SystemException{</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">....</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">}</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Any
help is appreciated.</span></p>

</div>

</div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

<div class="ecxecxMsoNormal" align="center" style="text-align:center"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">

<hr size="2" width="100%" align="center" id="ecxecxstopSpelling">

</span></div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">From:
noseya_at_hotmail.com<br>
To: users_at_jersey.dev.java.net<br>
Date: Tue, 22 Sep 2009 13:50:08 +0200<br>
Subject: [Jersey] 400 Bad Request (bug?)<br>
<br>
Hi all :)</span></p>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">I'm
getting this error, and i think that is a bug. This is my request:</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">POST
/projects/1/vulnerabilities HTTP/1.1</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Host:
localhost</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">User-Agent:
Mozilla/5.0 (Windows; U; Windows NT 6.0; es-ES; rv:1.9.1.3) Gecko/20090824
Firefox/3.5.3 (.NET CLR 3.5.30729)</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Accept:
application/json, text/javascript, */*</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Accept-Language:
ca,en-us;q=0.7,it;q=0.3</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Accept-Encoding:
gzip,deflate</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Accept-Charset:
ISO-8859-1,utf-8;q=0.7,*;q=0.7</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Keep-Alive:
300</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Proxy-Connection:
keep-alive</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Content-Type:
application/x-www-form-urlencoded; charset=UTF-8</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">X-Requested-With:
XMLHttpRequest</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Referer:
http://localhost/projects/1/vulnerabilities/new</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Cookie:
JSESSIONID=16f95e59d3b1b0e954310c190c60</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Content-Length:
161</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">identifier=identifier&amp;usersId=1&amp;statusId=1&amp;weaknessesId=4&amp;name=name&amp;description=description&amp;visibility=I&amp;<b>standardProvidersCodesId=</b>&amp;severity=2&amp;difficulty=2&amp;risk=1</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">THe
response is 400 Bad Request.</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">What
you see in bold is causing the bad request. Take it out and works fine.</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Thanks,</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

</div>

<div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Jordi</span></p>

</div>

</div>

</div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

<div class="ecxecxMsoNormal" align="center" style="text-align:center"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">

<hr size="2" width="100%" align="center">

</span></div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Charlas
más divertidas con el nuevo <a href="http://download.live.com">Windows Live
Messenger</a></span></p>

</div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">&nbsp;</span></p>

<div class="ecxecxMsoNormal" align="center" style="text-align:center"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">

<hr size="2" width="100%" align="center">

</span></div>

<p class="ecxecxMsoNormal"><span style="font-size:10.0pt;font-family:'Verdana','sans-serif'">Comparte
tus fotos con tus amigos. Más fácil con <a href="http://download.live.com">Windows Live</a></span></p>

</div></div> <br><hr>Diferentes formas de estar en contacto con amigos y familiares. Descúbrelas. <a href="http://www.microsoft.com/windows/windowslive/default.aspx">Descúbrelas.</a></div> <br /><hr />Nuevo Windows Live, un mundo lleno de posibilidades <a href='http://www.microsoft.com/windows/windowslive/default.aspx' target='_new'>Descúbrelo.</a></body>
</html>
--_1dcad023-c207-42dd-9e8c-faf32ead60b3_--