Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import of javax.servlet.*; and javax.servlet.http.*; is not working. Tomcat 7 is working. Help

Status
Not open for further replies.

csphard

Programmer
Apr 5, 2002
194
US
I am trying to import the following, but for some reason it is not working.

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

I jsut set up Tomcat 7 and it is working. Is there anything else I have to do so that it can see the things I am trying to import?

Howard

Error's I am receiving

C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\webdev\WEB-INF\cl
asses\exercises\intro>javac FirstServlet.java
FirstServlet.java:4: error: package javax.servlet does not exist
import javax.servlet.*;
^
FirstServlet.java:5: error: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
FirstServlet.java:8: error: cannot find symbol
public class FirstServlet extends HttpServlet {
^
symbol: class HttpServlet
FirstServlet.java:10: error: cannot find symbol
public void doGet(HttpServletRequest req, HttpServletResponse res)
^
symbol: class HttpServletRequest
location: class FirstServlet
FirstServlet.java:10: error: cannot find symbol
public void doGet(HttpServletRequest req, HttpServletResponse res)
^
symbol: class HttpServletResponse
location: class FirstServlet
FirstServlet.java:11: error: cannot find symbol
throws ServletException, IOException {
^
symbol: class ServletException
location: class FirstServlet
6 errors

C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\webdev\WEB-INF\cl
asses\exercises\intro>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top