Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

response.sendRedirect

 
Prem Khan
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic