I am building a web application for my lesson using Java servlets. At some point, I want to redirect to a jsp page, sending also some information that I want to use there (using the GET method). In my servlet, I have the following code:
String link = new String("index.jsp?name="+metadata.getName()+"&title="+metadata.getTitle());
response.sendRedirect(response.encodeRedirectURL(link));
In jsp, I get these options using
<%
request.getParameter("name");
request.getParameter("title");
%>
Everything works fine, except when the parameters do not contain only Latin characters (in my case, they may contain Greek characters). For example, if name = ΕΡΕΥΝΑΣ I get name = ¡¥. How can I fix this encoding problem (install it in UTF-8)? Doesn't this work encodeRedirectURL ()? Should I also use encodeURL () at some point? I tried the latter, but the problem still existed.
Thanks in advance:)