aspose file tools*
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Servlet Redirect