This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP 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