I google and google for hours on how to do redirection in jsp or servlets. However, when I try to apply it, it does not work.
The code I have on the jsp page is:
<% String articleId = request.getParameter("article_id").toString(); if(!articleId.matches("^[0-9]+$")) { response.sendRedirect("index.jsp"); } %>
I know from debugging that regexp works, and if at any time articleId is not a number, if goes inside, however, when it reaches response.sendRedirect, it does not actually redirect.
Did I miss something very fundamental in this case?
Thanks in advance.
java regex jsp servlets jstl
Dmitris
source share