aspose file tools*
The moose likes Servlets and the fly likes RequestDisptacher include() and forward() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDisptacher include() and forward()" Watch "RequestDisptacher include() and forward()" New topic
Author

RequestDisptacher include() and forward()

Hung Tang
Ranch Hand

Joined: Feb 14, 2002
Posts: 148
Just a question:
I have two servlets and one jsp; they are:
ControlServlet
IncludeServlet
forward.jsp
ControlServlet will use dispatcher.include("IncludeServlet"). IncludeServlet stores a string object by way of request.setAttribute("key", "value"); ControlServlet regains control again and use dispatcher.forward("/forward.jsp").
My question is, is the string object is still stored in the request object when control is passed to forward.jsp? What i mean is, can forward.jsp use <%= request.getAttribute("key") %> and expect to see "value" on its page?
Thanks
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Yes
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: RequestDisptacher include() and forward()