• Post Reply Bookmark Topic Watch Topic
  • New Topic

Use Filter to goto different jsp page?  RSS feed

 
Michael Remijan
Author
Ranch Hand
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forum:
If a url like http://server/myapp/foo.jsp is type directly into the netscape or ie, does the request/response still go through a filter set on that webapp? If so, could someone give a little pseudo-code example on how I could use the filter goto a different page, NOT foo.jsp.
Thanks,
Michael.
 
Chris Stehno
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use the request dispatcher from the request object (may need to caste it as an HttpServletRequest).
request.getRequestDispatcher("/your/new/page.jsp").forward(request,response);
- or -
if you want to go to a page off of your site, use...
response.sendRedirect("http://blah.com");
Hope that helps a little.
Chris
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!