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