• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java don't compile my servlet.

 
Stoian Ovidiu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic