[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [eclipse-announce] (no subject)

you need to add the jar to the classpath  ( for linux: .classpath file
in your workspace directory). dunno if there's an easier way than
editing the file manually. i'm an eclipse newbie.

On Tue, 2001-12-11 at 15:09, Tom Troonbeeckx wrote:
> import java.io.*;
> import java.util.*;
> import javax.servlet.*;
> Dear Eclipsers,
> 
> For compiling a servlet I have imported the jar-file from Tomcat into a Eclipse-projects.
> The import seems working fine, however. When i compile the servlet I get the following message.
> 
> 	HttpServletRequest cannot be resolved.
> 
> Here's the very easy servlet-code.
> 
> 	import javax.servlet.http.*;
> 
> 	public class DaytimeServlet extends HttpServlet {
> 
> 	       public Date getDate() {
>         	 return new Date();
> 	       }
> 
> 	       public void doGet(HttpServletRequest req, HttpServletResponse res)
>                                     throws ServletException, IOException {
>         	 res.setContentType("text/plain");
> 	         PrintWriter out = res.getWriter();
>         	 out.println(getDate().toString());
> 	       }	
> 
> 	       public void doPost(HttpServletRequest req, HttpServletResponse res)
>                                      throws ServletException, IOException {
>         	 doGet(req, res);
> 	       }
> 	}
> 
> Any ideas to solve this problem?
> 
> Thanks in advance!