File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDisptacher include() and forward()" Watch "RequestDisptacher include() and forward()" New topic

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 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?
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
I agree. Here's the link:
subject: RequestDisptacher include() and forward()