Hi Paul,

at compile time you need to have servlet.jar inside your 
classpath.

See the Application Developers' Guide at
pathToTomcat/webapps/tomcat-docs/appdev/index.html

Andreas


On 26 Nov 2002 at 16:36, [EMAIL PROTECTED] wrote:

> I tried debugging the source through, my IDE and it threw a
> java.lang.NoSuchMethodError: main
> 
> I tried compiling the source through the command prompt and got 
> a load of 'cannot resolve symobol' errors (useful). Below is the
> entire servlet, any ideas where the problem is? The first 2 of 5
> errors when compiling from DOS is: 
> 
> " LoadMycompServletAtStartup.java:10:package javax.servlet does
> not exist "
> 
> and 
> 
> " LoadMycompServletAtStartup.java:11:package javax.servlet.http
> does not exist "
> 
> Do I have a system problem here? The servlet in question below.
> On jave -version I am using VM build 1.4.1...
> 
> thanks!
> 
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.util.Hashtable;
> 
> public class LoadMycompServletAtStartup implements
> ServletContextListener {
> 
>   public void contextInitialized(ServletContextEvent sce) {
> 
>     ServletContext sc = sce.getServletContext();
> 
>     Hashtable style_index = new Hashtable();
> 
>     style_index.put("element1", "ONE");
>     style_index.put("element2", "TWO");
> 
>     sc.setAttribute("style_index", style_index);
>   } 
>   public void contextDestroyed(ServletContextEvent sce) {    }
> 
> }
> 



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

Reply via email to