I am developing a struts2 project with tiles in which I want to use the keyword for redirecting from one jsp page to other page as,
<%
response.sendRedirect("search");
%>
In normal jsp pages the code is working as.
response.sendRedirect("search.jsp");
but when I use with tiles, its not working.
when I am running the page directly its redirecting, but when I call this some other page its not redirecting. I tried the code with blank html page without any other codings, still its not working.
"search" is the name of the action in struts.xml page. Is there any extra attribute I need to add in response.sendRedirect ?
Currently I am using
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=search">
for doing my job. Whether it will create any problem in any aspect?
I checked it with conditions for redirecting to multiple places, its working.
<%
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 answer, tried like this
response.sendRedirect("viewuniqueRedirect");
in page and
<action name="viewuniqueRedirect" > <result type="chain">viewunique</result> </action>
in struts.xml, but not working