• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

java don't compile my servlet.

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solved.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic