Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Erickson explained this very well on this page. A server-independent solution is to use a character encoding filter, à la org.springframework.web.filter.CharacterEncodingFilter. See example below:</p> <pre><code>import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; public class EncodingFilter implements Filter { private String encoding = "utf-8"; public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { request.setCharacterEncoding(encoding); filterChain.doFilter(request, response); } public void init(FilterConfig filterConfig) throws ServletException { String encodingParam = filterConfig.getInitParameter("encoding"); if (encodingParam != null) { encoding = encodingParam; } } public void destroy() { // nothing todo } } </code></pre> <p>In web.xml add the filter declaration and the filter url mapping in the appropriate sections:</p> <pre><code> &lt;filter&gt; &lt;filter-name&gt;EncodingFilter&lt;/filter-name&gt; &lt;description&gt; &lt;![CDATA[Changes the encoding of the request, in order to help the appserver to correctly interpret request params]]&gt; &lt;/description&gt; &lt;filter-class&gt;com.mypackage.EncodingFilter&lt;/filter-class&gt; &lt;init-param&gt; &lt;param-name&gt;encoding&lt;/param-name&gt; &lt;param-value&gt;ISO-8859-15&lt;/param-value&gt; &lt;/init-param&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;EncodingFilter&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload