Thread: Noob Java Error
View Single Post
Old Jun 8th, 2007, 5:44 AM   #1
lucifer
Programmer
 
lucifer's Avatar
 
Join Date: Oct 2005
Posts: 84
Rep Power: 4 lucifer is on a distinguished road
Noob Java Error

Hi i m learning java n
i have written the following program but it does not compile
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Simple implements Filter
{
	 public void doFilter(ServletRequest request, ServletResponse response,    FilterChain chain)
    throws IOException, ServletException
  {
  
  }

  public void destroy()
  {
   
  }

  public void init(FilterConfig filterConfig)
  {
   
  }

}

when i come i get following errors
simple.java:4: class Simple is public, should be declared in a file named Simple.java
public class Simple implements Filter
       ^
simple.java:2: package javax.servlet does not exist
import javax.servlet.*;
^
simple.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
simple.java:4: cannot find symbol
symbol: class Filter
public class Simple implements Filter
                               ^
simple.java:6: cannot find symbol
symbol  : class ServletRequest
location: class Simple
	 public void doFilter(ServletRequest request, ServletResponse response,
	                      ^
simple.java:6: cannot find symbol
symbol  : class ServletResponse
location: class Simple
	 public void doFilter(ServletRequest request, ServletResponse response,
	                                              ^
simple.java:7: cannot find symbol
symbol  : class FilterChain
location: class Simple
    FilterChain chain)
    ^
simple.java:8: cannot find symbol
symbol  : class ServletException
location: class Simple
    throws IOException, ServletException
                        ^
simple.java:18: cannot find symbol
symbol  : class FilterConfig
location: class Simple
  public void init(FilterConfig filterConfig)
plz help
__________________
"You're good... but me, I'm magic"
lucifer is offline   Reply With Quote