The Artima Developer Community
Sponsored Link

Java Answers Forum
Error with java SimpleServlet

2 replies on 1 page. Most recent reply: May 15, 2003 2:39 AM by Kariyavula RamaRao

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Eric Cantona

Posts: 5
Nickname: god
Registered: May, 2003

Error with java SimpleServlet Posted: May 12, 2003 4:35 AM
Reply to this message Reply
Advertisement
F:\Servlets Project\SimpleServlet.java:3: package javax.servlet does not exist
import javax.servlet.*;
^
F:\Servlets Project\SimpleServlet.java:5: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
F:\Servlets Project\SimpleServlet.java:7: cannot resolve symbol
symbol : class HttpServlet
location: class SimpleServlet
public class SimpleServlet extends HttpServlet {
^
F:\Servlets Project\SimpleServlet.java:15: cannot resolve symbol
symbol : class HttpServletRequest
location: class SimpleServlet
public void doGet (HttpServletRequest request, HttpServletResponse response)
^
F:\Servlets Project\SimpleServlet.java:15: cannot resolve symbol
symbol : class HttpServletResponse
location: class SimpleServlet
public void doGet (HttpServletRequest request, HttpServletResponse response)
^
F:\Servlets Project\SimpleServlet.java:17: cannot resolve symbol
symbol : class ServletException
location: class SimpleServlet
throws ServletException, IOException {
^
6 errors


srini_gogi

Posts: 1
Nickname: gogi
Registered: May, 2003

Re: Error with java SimpleServlet Posted: May 14, 2003 3:05 AM
Reply to this message Reply
Hi,
You are getting erors because u have not set the servlet.jar in the class path.this jar will contain the support for HTTP Servlets.
Srinivas

> F:\Servlets Project\SimpleServlet.java:3: package
> javax.servlet does not exist
> import javax.servlet.*;
> ^
> F:\Servlets Project\SimpleServlet.java:5: package
> javax.servlet.http does not exist
> import javax.servlet.http.*;
> ^
> F:\Servlets Project\SimpleServlet.java:7: cannot resolve
> symbol
> symbol : class HttpServlet
> location: class SimpleServlet
> public class SimpleServlet extends HttpServlet {
> ^
> F:\Servlets Project\SimpleServlet.java:15: cannot resolve
> symbol
> symbol : class HttpServletRequest
> location: class SimpleServlet
> public void doGet (HttpServletRequest request,
> HttpServletResponse response)
> ^
> F:\Servlets Project\SimpleServlet.java:15: cannot resolve
> symbol
> symbol : class HttpServletResponse
> location: class SimpleServlet
> public void doGet (HttpServletRequest request,
> HttpServletResponse response)
> ^
> F:\Servlets Project\SimpleServlet.java:17: cannot resolve
> symbol
> symbol : class ServletException
> location: class SimpleServlet
> throws ServletException, IOException {
> ^
> 6 errors

> F:\Servlets Project\SimpleServlet.java:3: package
> javax.servlet does not exist
> import javax.servlet.*;
> ^
> F:\Servlets Project\SimpleServlet.java:5: package
> javax.servlet.http does not exist
> import javax.servlet.http.*;
> ^
> F:\Servlets Project\SimpleServlet.java:7: cannot resolve
> symbol
> symbol : class HttpServlet
> location: class SimpleServlet
> public class SimpleServlet extends HttpServlet {
> ^
> F:\Servlets Project\SimpleServlet.java:15: cannot resolve
> symbol
> symbol : class HttpServletRequest
> location: class SimpleServlet
> public void doGet (HttpServletRequest request,
> HttpServletResponse response)
> ^
> F:\Servlets Project\SimpleServlet.java:15: cannot resolve
> symbol
> symbol : class HttpServletResponse
> location: class SimpleServlet
> public void doGet (HttpServletRequest request,
> HttpServletResponse response)
> ^
> F:\Servlets Project\SimpleServlet.java:17: cannot resolve
> symbol
> symbol : class ServletException
> location: class SimpleServlet
> throws ServletException, IOException {
> ^
> 6 errors

Kariyavula RamaRao

Posts: 1
Nickname: ramarao
Registered: May, 2003

Re: Error with java SimpleServlet Posted: May 15, 2003 2:39 AM
Reply to this message Reply
u have to just specify the jar file available.
u can do that by setting the classpath.

for setting class path;
press
start->settings->control panel->system.
click on advanced tab
then click on environment variables
there u have 2 boxes
in the above box check whether u have a variable called CLASSPATH(case doesn't matter)
if it is available then click on edit
and add the path of ur servlet.jar file

if that variable is not available then click on new and type Classpath in variable name and the path of the servlet.jar as variable value.

Flat View: This topic has 2 replies on 1 page
Topic: Using Java to Calculate Semester Hours Previous Topic   Next Topic Topic: [b]how to access data with java_J2EE app using crystal report v9?[/b]

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use