This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
 
Consider Paul's rocket mass heater.
 
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?