I have a problem passing my parameters in springMVC.
@RequestMapping(value = "/", method = RequestMethod.POST)
public String homePost(Model model, HttpServletRequest request) {
StringBuilder redirect = new StringBuilder();
String para = request.getParameter("keyword");
redirect.append("redirect:/search?" + "cat=0&job="+ para);
logger.info("Page called: SEARCH; Called parameter: KEYWORD: " + redirect.toString());
return redirect.toString();
}
In my console, I can see:
Page called: SEARCH; Called parameter: KEYWORD: redirect:/search?cat=0&job=lol лол lol
But my URL is
http://localhost:8088/search?cat=0&job=lol%20%20%20%20%20lol
I set my all encoding in "UTF-8" and I am trying to search from list using Cyrillic but it keeps converting Cyrillic letters into empty spaces. I can search using Latin letters. If I write in the URL manually using Cyrillic letters, I can also search. In the console, it also shows
bind => [%lol lol%]
Thank you.
P.S Even if I did not use StringBuilder, I have the same problem. P.S.S My web.xml has
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>