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

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!