I have a filter where I'm first fetching the request param and then setting the Character Encoding
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException {
final HttpServletRequest request = (HttpServletRequest) servletRequest;
final HttpServletResponse response = (HttpServletResponse) servletResponse;
final String name = request.getParameter("name");
request.setCharacterEncoding("UTF-8");
This is not working. As explained in request.getCharacterEncoding() returns NULL... why? that if we dont set the encoding the default is set.
Can we change the encoding once the default is set ? If not what is the exact reason