File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes java don't compile my servlet. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "java don Watch "java don New topic
Author

java don't compile my servlet.

Stoian Ovidiu
Greenhorn

Joined: Jul 07, 2008
Posts: 6
I have this code:


if I want to compile:
HelloWorld.java:6: package javax.servlet does not exist
import javax.servlet.ServletException;
^
HelloWorld.java:7: package javax.servlet.annotation does not exist
import javax.servlet.annotation.WebServlet;
^
HelloWorld.java:8: package javax.servlet.http does not exist
import javax.servlet.http.HttpServlet;
^
HelloWorld.java:9: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
^
HelloWorld.java:10: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletResponse;
^
HelloWorld.java:16: cannot find symbol
symbol: class HttpServlet
public class HelloWorld extends HttpServlet {
^
HelloWorld.java:15: cannot find symbol
symbol: class WebServlet
@WebServlet("/HelloWorld")
^
HelloWorld.java:30: cannot find symbol
symbol : class HttpServletRequest
location: class HelloWorld
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
HelloWorld.java:30: cannot find symbol
symbol : class HttpServletResponse
location: class HelloWorld
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
HelloWorld.java:30: cannot find symbol
symbol : class ServletException
location: class HelloWorld
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
HelloWorld.java:38: cannot find symbol
symbol : class HttpServletRequest
location: class HelloWorld
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
HelloWorld.java:38: cannot find symbol
symbol : class HttpServletResponse
location: class HelloWorld
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
HelloWorld.java:38: cannot find symbol
symbol : class ServletException
location: class HelloWorld
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
13 errors

Stoian Ovidiu
Greenhorn

Joined: Jul 07, 2008
Posts: 6
Solved.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java don't compile my servlet.