[seam-issues] [JBoss JIRA] Commented: (JBSEAM-4521) Using JQuery to submit an Ajax request (POST), the data haven't populated in the background the according RESTFul method

liu xj (JIRA) jira-events at lists.jboss.org
Mon Jan 11 00:51:30 EST 2010


    [ https://jira.jboss.org/jira/browse/JBSEAM-4521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12503224#action_12503224 ] 

liu xj commented on JBSEAM-4521:
--------------------------------

Sorry, should be if(!mediaType.equals(MediaType.APPLICATION_FORM_URLENCODED_TYPE)&&mediaType.toString().indexOf(MediaType.APPLICATION_FORM_URLENCODED)==-1) return false;

> Using JQuery to submit an Ajax request (POST), the data haven't populated in the background the according RESTFul method
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBSEAM-4521
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4521
>             Project: Seam
>          Issue Type: Bug
>          Components: Core
>         Environment: Jetty 6.1.22+ Seam 2.2.0.GA + resteasy-jaxrs 1.1-RC2/1.2.RC1 + jaxrs-api 1.1-RC2/1.2.RC1 
>            Reporter: liu xj
>
> Using JQuery to submit an Ajax request (POST), the data haven't populated in the background the according RESTFul method
> ---------
> 1. the enviroment is perfect well.
> 2. Look into the resteasy-jaxrs code, and find the method
>    - isFormData in the org.jboss.resteasy.core.MessageBodyParameterInjector
>     the code is
>      if (!mediaType.equals(MediaType.APPLICATION_FORM_URLENCODED_TYPE)) return false;
>   
>     need do some enhancement.
>    coz, using Ajax send request, it will always have charset or other properties. So, the Content-Type will be [Content-Type=application/x-www-form-urlencoded; charset=UTF-8] and at this time the mediaType will be "application/x-www-form-urlencoded; charset=UTF-8", so, here the code should be changed as below
> if(!mediaType.equals(MediaType.APPLICATION_FORM_URLENCODED_TYPE)||mediaType.toString().indexOf(MediaType.APPLICATION_FORM_URLENCODED)==-1) return false;
> no need compare the MediaType.parameters

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list