Please disregard my previous question, it actually works as expected.

However, I have another question.   It appears that even I set a Java bean scope to be
'session' in a jsp file, it will still time out after about 30 minutes.   For example,
if I define a bean like this in my jsp file:
    <jsp:useBean id="cdstore" scope="session" class="sample.CDStore" />
Then on submit, a servlet would do the following:
      HttpSession session = request.getSession();
      CDCatalog c = (CDCatalog)session.getAttribute("cdstore");

The variable c returns null after about 30 minutes.   Is this a configurable parameter
in Tomcat?    Has anyone experienced something like this?     Thanks.


--Richard

Richard Lui wrote:

> HI,
>
> I'm using Apache-Tomcat and I'm having problem getting the cookie from the client.
> In a html form, click 'Go' trigger the following:
> <form action="/sample/WizardStart.jsp" method=GET>
> <table>
>    <tr><td>
>    <input type=submit value="Go">
>    <input type=hidden name="company" value="ABC Company">
>    </td></tr>
> </table>
> </form>
>
> Inside WizardStart.jsp, I put in some code to check what's stored in client cookie:
>
> <%
>      Cookie  ckobj_a[] = request.getCookies();
>       int    num_ckobj = 0;
>       String reqValue = null;
>
>       if (ckobj_a != null)
>       {
>          num_ckobj = ckobj_a.length;
>       }
>       for (int i = 0; i < num_ckobj; ++i)
>       {
>          Cookie   ckobj = ckobj_a[i];
> System.out.println ("Checking cookie: " + ckobj.getName());
>       }
> %>
>
> I got "Checking cookie: JSESSIONID" in the tomcat console.   I expect to see the
> client's cookies, what's going on here?   Thanks.
>
> --Richard
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to