This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

java don't compile my servlet.

 
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.
 
I don't even know how to spell CIA. But this tiny ad does:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic