post - null in FormParam with "charset=UTF-8" in Jersey 2.0 -
i'm working on angularjs project , i'm calling rest services using content-type "application/x-www-form-urlencoded;".
on server side use jersey in version 2.0. maven dependency.
<dependency> <groupid>org.glassfish.jersey.containers</groupid> <artifactid>jersey-container-servlet-core</artifactid> <version>2.0</version> </dependency>
everthing work fine on chrome , ie7. problem firefox add mystically "charset=utf-8" in content type.
i made test , if use postman , set "application/x-www-form-urlencoded; charset=utf-8" in content type, jersey has null in formparam parameters
this header of method in java
@post @produces(mediatype.application_json) @path("movements/") public response movements( @formparam("compte_no") string compte_no, @formparam("compte_bidule") string compte_bidule, @formparam("compte_machin") string compte_machin,
i tried headers
@post @produces(mediatype.application_json) @path("movements/") @consumes({mediatype.application_form_urlencoded + ";charset=utf-8", mediatype.application_form_urlencoded + "; charset=utf-8", mediatype.application_form_urlencoded}) public response movements( @formparam("compte_no") string compte_no, @formparam("compte_bidule") string compte_bidule, @formparam("compte_machin") string compte_machin,
and had same problem. have idea ? in advance.
this question duplication. response can found on jersey , @formparam not working when charset specified in content-type
jersey ticket , filter has workaround can found on ticket
Comments
Post a Comment