• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp redirect page

 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,
I have an condition statment in my .jsp page, and one of the conditions has to result in opening a different page (same window). In javascript it's done with this syntax: window.location.replace("http://livewire2/engineering/epis.shtml.
But how can I do the same thing in a .jsp page?
 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it. I ended up using javascript indirectly:
out.println("<script>");
out.println("window.location.replace('http://livewire2/engineering/epis.shtml')");
out.println("</script>");
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, that's an incredibly inefficient and messy way to do it.

Why not just employ the JSTL <c:redirect> action?
 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I will!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!