tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Chen" <>
Subject RE: Tomcat 4.0 Beta3 and Request Attributes Error
Date Wed, 02 May 2001 20:13:32 GMT
RequestDispatcher.forward() returns immediately BUT the JSP page has not
been processed yet! The JSP page will only be processed after the servlet
finishes the work, i.e., your doGet or doPost returns. Therefore, there is
no way to access attributes in the JSP page inside the calling servlet.


Charles Chen

-----Original Message-----
From: Ana []
Sent: 02 May 2001 17:23
To: :
Subject: Tomcat 4.0 Beta3 and Request Attributes Error

We think we have discovered an error. We call the include method of the
RequestDispatcher from a servlet. Then,  we  call the setAttribute method
of the request object  of the included JSP. If we call the getAttribute
method of the request object in the servlet (after the include call), then
there is not attribute.


public void service(ServletRequest request, ServletResponse response){

    Object obj = request.getAttribute("MyAttribute");
    // obj is null !!!!!!!!!!!!!!!!!!!!!!!!!!!!


    request.setAttribute("MyAttribute", obj);

Thank you.

Do You Yahoo!?
Get your free address at

View raw message