Not quite right !
application is an implicit object available within jsp's and not servlets.
In case of servlets you could get a handle to the ServletContext object with
the following line of code :
ServletContext context = getServletConfig().getServletContext();
Then use the repective methods mentioned in the ServletContext interface to
store and retrieve the application level objects.
Hope this helps.
Have a nice day.
With regards,
Sachin S. Khanna
http://www.emailanorder.com
----- Original Message -----
From: Atilio Ranzuglia <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 28, 2001 8:18 PM
Subject: Re: placing data in Application level from servlets
> Anyway, application is an implicit object, so you can
> use without declaration.
>
> In this case, you can do the following:
> application.getAttribute("objectName") or
> application.getValue("objectName")
> It depends on the servlet API version you are using.
> The first one is for servlet's version 2.2 and the
> second one is servlet's version 2.1.
>
> Hope this help
> Atilio
>
>
> --- Mattias Jiderhamn <[EMAIL PROTECTED]> wrote:
> > > wondering if anyone has any ideas on how to access
> > the application
> > level
> > > objects ( i.e similar to ASP application object)
> > using a servlet?
> >
> > Try pageContext.getAttribute("objectName",
> > PageContext.SESSION_SCOPE );
> > See javax.servlet.jsp.PageContext for documentation
> >
> > Mattias Jiderhamn
> > Expert Systems
> > [EMAIL PROTECTED]
> >
> >
>
===========================================================================
> > 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://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
> =====
> Ing. Atilio Ranzuglia Buteler
> [EMAIL PROTECTED]
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.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://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
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://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets