You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrea Mari <ma...@tin.it> on 2001/05/10 16:56:30 UTC

jsp and servlet

Hi,

in a jsp page I have an object with scope application. Can I use this object
from a servlet?

Thanks
Andrea


Re: jsp and servlet

Posted by Egidijus Drobavicius <eg...@vb.lt>.
According to JSP specification, objects with a scope application are stored
to context object's hashtable which is supposed to be one for the
application.
This means that if you store object once (<jsp:useBean id="myBean"
class="myclass" scope="application"/>) each time later it will not be
created and useBean will return the same object.
>From the servlet for retrieval i use context (i have HTTPServlet, and do
this.getServletContext().getAttribute("myBean"))


----- Original Message -----
From: "Andrea Mari" <ma...@tin.it>
To: <to...@jakarta.apache.org>
Sent: Thursday, May 10, 2001 4:56 PM
Subject: jsp and servlet


> Hi,
>
> in a jsp page I have an object with scope application. Can I use this
object
> from a servlet?
>
> Thanks
> Andrea
>
>