| Author |
response.sendRedirect();jsp:forward;<c:redirect>
|
Balaji Bang
Ranch Hand
Joined: Apr 23, 2007
Posts: 180
|
|
Hi
In my jsp I want to forward the request to some other jsp based on a session attribute.
and bothe jsps are in same folder under webcontent. I am using Struts tiles.
I tried with "/index.jsp" and "./index.jsp" and "MyApp/index.jsp" and
Nothing is working
Please help me ...
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9191
|
|
|
Is there any content before this redirect?? If the response is committed before you redirect, you'll get this behavior...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
Balaji Bang
Ranch Hand
Joined: Apr 23, 2007
Posts: 180
|
|
Before that I have Page imports ,
How to handle these kind of situations???
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9191
|
|
|
Generally you should not face a situation where you have to redirect from a JSP. This means that you are putting logic into the JSP, which is not a very good idea. Anyways if you are just doing this for practice, move the logic above any content that you are generating instead of after the head tag...
|
 |
 |
|
|
subject: response.sendRedirect();jsp:forward;<c:redirect>
|
|
|