I am developing a struts2 project with elements in which I want to use the keyword to redirect from one jsp page to another page, since
<% response.sendRedirect("search"); %>
On regular jsp pages, the code works like.
response.sendRedirect("search.jsp");
but when i use tiles it doesn't work.
when I launch the page directly, redirecting it, but when I call this other page, it does not redirect. I tried the code with an empty html page without any other encodings, but it didn't work.
"search" is the name of the action on the struts.xml page. Is there an additional attribute that I need to add to response.sendRedirect?
I am currently using
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=search">
to do my job. Will this create any problems in any aspect?
I checked it with the conditions for redirecting to several places, its work.
<% int k=0; if(k==1){ %> <META HTTP-EQUIV="Refresh" CONTENT="0;URL=search"> <% } else { %> <META HTTP-EQUIV="Refresh" CONTENT="0;URL=guestprofile"> <% } %>
As I understood from the answer, I tried it like this
response.sendRedirect("viewuniqueRedirect");
on page and
<action name="viewuniqueRedirect" > <result type="chain">viewunique</result> </action>
in struts.xml but not working
jsp struts struts2 response.redirect tiles
Sarin jacob sunny
source share