I'm building a web app for my lesson using java servlets. At some point i want to redirect to a jsp page, sending also some info that 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 the jsp, I get these parameters using
<%
request.getParameter("name");
request.getParameter("title");
%>
Everything works fine, except when the parameters do not contain only latin characters (in my case they can contain greek characters). For example if name=ΕΡΕΥΝΑΣ i get name=¡¥. How can i fix this encoding problem (setting it to UTF-8)? Isn't encodeRedirectURL() doing this job? Should I also use encodeURL() at some point? I tried the last one but problem still existed.
Thanks in advance :)