Rupesh Choubey wrote:

>
>
>  we've tried storing all the information (state) we need in the
> session object which is available to the servlet...hence, if we need
> to store the userId in for the next request/page, we actually do....
>
>
>         session.putValue("userId", currentUserId);
>
> i dont know any other way to do this...........perhaps Craig or
> someone else can help us more .....
> cheers,
> rupesh.
>

That's pretty much the standard way to store per-user variables.  This
object then becomes visible to JSP pages (in the same application) with
an action like:

    <jsp:useBean id="userid" scope="session" class="....." />

For JSP developers that are new to session management concepts, I would
suggest that you review the Servlet Trail in the Java Language Tutorial
(http://java.sun.com/docs/books/tutorial).  The semantics of session
management, and how session identity is maintained across requests, are
the same for servlets and JSP pages.  Just think of the HttpSession
object as the place where any beans with scope="session" can be found.

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to