java - Tomcat post special characters -


in maven project have html form post data httpservlet. on moment post special characters in html form (e.g. "jänsen", httpservlet receives "jänsen".

i think need change settings utf-8 don't know have that...

you can try configure org.apache.catalina.filters.setcharacterencodingfilter in web.xml next:

<filter>     <filter-name>set character encoding</filter-name>     <filter-class>org.apache.catalina.filters.setcharacterencodingfilter</filter-class>     <init-param>         <param-name>encoding</param-name>         <param-value>utf-8</param-value>     </init-param>     <init-param>         <param-name>ignore</param-name>         <param-value>false</param-value>     </init-param> </filter> <filter-mapping>     <filter-name>set character encoding</filter-name>     <url-pattern>/*</url-pattern> </filter-mapping> 

filter sets character encoding used in parsing incoming request, either unconditionally or if client did not specify character encoding.

more info filter here


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -