You mean as in application = some declaration? How is it declared? Like 
session, I am used too just defining it, and thats it (in JSP).  Like 
session, is application not a keyword?

Thanks

Paul.





Kwok Peng Tuck <[EMAIL PROTECTED]>
25-11-2002 12:13
Please respond to "Tomcat Users List"

 
        To:     Tomcat Users List <[EMAIL PROTECTED]>
        cc: 
        Subject:        Re: servlet startup compile error


You must declare what is application, this is fine in jsp as this is 
made available to all jsp, like session.setAttribute stuff.


[EMAIL PROTECTED] wrote:

>I am editing and compiling from NetBeans, it gives:
>
>..[23:1] cannot resolve symbol
>application.setAttribute("style_index", style_index);
>^
>1 Error
>
>the entire line is underlined red in the editor 
>
>any ideas? 
>
>here is the entire servlet placed in myApp/WEB-INF/classes:
>
>import java.io.*;
>import javax.servlet.*;
>import javax.servlet.http.*;
>import java.util.Hashtable;
> 
>public class LoadMycompServletAtStartup implements ServletContextListener 

>{
> 
>  public void contextInitialized(ServletContextEvent sce) {
> 
>    Hashtable style_index = new Hashtable();
> 
>    style_index.put("element1", "ONE");
>    style_index.put("element2", "TWO");
> 
>    application.setAttribute("style_index", style_index); // compile 
error
> 
>    } 
>  public void contextDestroyed(ServletContextEvent sce){
>     // Notification that the servlet context is about to be shut down 
>    }
> 
>}
>
>thanks
>
>
> 
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



Reply via email to