File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes response.sendRedirect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "response.sendRedirect" Watch "response.sendRedirect" New topic
Author

response.sendRedirect

Prem Khan
Ranch Hand

Joined: May 30, 2005
Posts: 189
This is weird this code will not redirect the if statment becomes true and prints to the log but the page does not redirect ? I would apreciate any help on this... thanks

<% if (session.isNew()) {
System.out.println("isNew == true ... TRYING TO REDIRECT");
response.sendRedirect("/IRIS/index.jsp");
}

System.out.println(session.getAttribute("FirstPageViewed") + "11221" );

if (session.getAttribute("FirstPageViewed") == null){
System.out.println("FIRST PAGE VIEWED == NULL ... TRYING TO REDIRECT");
response.sendRedirect("/IRIS/index.jsp");
}
%>
Prem Khan
Ranch Hand

Joined: May 30, 2005
Posts: 189
Well it looks like I solved this myself, but for anyone else haveing this probblems...

The page accually was redirecting, but still showed the content that was supposed to be pushed to the browser.

All I did to fix it was

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: response.sendRedirect
 
Similar Threads
Basic Session Validation
Session code doesn't get executed in jsp
submiting the output in same page
struts 2 + how to redirect Page after Login validation
session expiry