If you're referring to the PageContext that is available when you are
rendering the view, the answer would be because it doesn't exist yet ;-)
The Struts ActionController (a servlet) calls an Action (not a servlet),
and may eventually forwards to a JSP (another servlet). The PageContext
for the JSP isn't available until it is called. The mechanism for
carrying information between HTTP forwards is the HttpServletRequest, or
the session to carry it between requests.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/


> suhas wrote:
> 
> Hi
> 
> The PageContext instance gives us access to implicit objects in the
> page
> .This is used mainly in JSP . Why Can't we have something in the
> Servlet
> ?
> Why to directly use HttpServletRequest , HttpSession in the Servlet ?
> Better can't we get this from the container specific implementaion
> something like PageContext in the Servlet too? .
> 
> Regards
> 
>

Reply via email to