permaculture playing cards
The moose likes Servlets and the fly likes to do a forward in servelt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "to do a forward in servelt" Watch "to do a forward in servelt" New topic

to do a forward in servelt

aakash bhatt
Ranch Hand

Joined: Jan 09, 2003
Posts: 182
In jso we have <jsp:forward> but in servelt how do i achieve the forward.
i want to do a forward instead of sendredirect how can i do ?

Raghunath Madhvapathi

Joined: Aug 26, 2004
Posts: 6
You can use RequestDispatcher for forwarding from servlet.

RequestDispatcher rd = getServletContext().RequestDispatcher("relative url of jsp").forward(req,res);
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Those are a couple of interesting new technologies you've invented there, Ashaak! I'm not sure that I can comment on JSO and Servelts but with JSP and Servlets it can be done as follows, from doGet() or doPost():

I agree. Here's the link:
subject: to do a forward in servelt
It's not a secret anymore!