Meaningless Drivel is fun!*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Servlet Redirect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Servlet Redirect" Watch "Servlet Redirect" New topic
Author

Servlet Redirect

amarkirt saroay
Ranch Hand

Joined: Mar 16, 2008
Posts: 167
Page 136 HFJS-Servlet Redirect

Can we redirect to another servlet? or should it be always a jsp or html page?
Can it be something like /foo/stuff.do ?

SCJP-75%
SCWCD-82%
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



Can we redirect to another servlet? or should it be always a jsp or html page?


Yes you can redierct to a Servlet considering you have not written anything to Servlet outputStream / Printwriter .


Can it be something like /foo/stuff.do ?


Check out the ServletContext getRequestDispatcher() or ServletRequest getRequestDispatcher () to understand the url patterns
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Redirect
 
Similar Threads
ActionForward redirecting to a page in another servlet context
redirect in target = parent
redirecting to a servlet from jsf trinidad
Servlet to html
getParameters names from jsp?