Package javax.servlet doesnot exist
i am using jsp and mysql along with jdk1.3.1_08, tomcat, redhat linux, apache for my current project. i decided to use servlets to enhance my project and make it more efficient.
however, when i compile TestServlet.java, it generates 10 errors.
one of these errors say that 'package javax.servlet' doesn't exist.
i tried searching j2ee.jar in my pc but my search results turn up empty.
so i checked the documentation and this is what it says :
Q: What do I need in my CLASSPATH?
A: All you need is a correct version of JDK (1.1.x or 1.2).
Since the JSP engine also uses 'javac' it needs to be in the CLASSPATH.
If you are using JDK 1.1.x it will automatically be included. If
you are using JDK 1.2 you will need to set JAVA_HOME to the directory
where JDK is installed or alternately you can put "tools.jar" in your
CLASSPATH.
All other classes, jar files that are needed, are put by the startserver
script and you don't need to worry about them.
Q: Where are the classes for JSPs and Servlets?
A: webserver.jar -- class files for Servlet Engine.
lib/jspengine.jar -- class files for JSP Engine.
lib/servlet.jar -- Public APIs for Servlet.
lib/jsp.jar -- Public APIs for JSP.
lib/xml.jar -- classes for parsing XML document
so, after reading the documentation, i put xml.jar, servlet.jar and webserver.jar in my classpath along with tools.jar and rt.jar
i tried searching for jspengine.jar and jsp.jar but my search results turn up empty. what should i do? by the way, below is my classpath (if it's any help at all):
export CLASSPATH=/usr/local/jdk1.3.1_08/jre/lib/rt.jar:/usr/java/lib/tools.jar:/usr/src/jakarta/dist/tomcat/lib/servlet.jar:/usr/src/jakarta/dist/tomcat/lib/webserver.jar:/usr/src/jakarta/dist/tomcat/lib/xml.jar:
i know a bit about java like methods, events, classes but i don't know much about jars and servlets. i'm still new to them so pls don't get mad
thank u very much
my problem was that i didn't reboot my pc thanks everyone for ur help!
Similar Messages
-
Package javax.ejb doesnot exist
I installed weblogic 10 on "D:\weblogic10\"
Java is installed on "C:\java"
I am getting the problem "package javax.ejb doesnot exist"
I came to know that this problem is due to the class path.
and we have to set the class path as "\\weblogic\lib\weblogicaux.jar"
I didn't set find "lib" directory and that jar file also.
I tried weblogic 9.1 and 7.0. But I was unable to find those in my weblogic directory.
How can I set the class path?Thanx for reply.
I'm repeating the problem:
I could not find "lib" directory and that jar file
also.
In the "D:\weblogic", the following are present:
Different direcotries:
jdk150_06,jrockit90_150_06,logs,modules,
tools,user_projects,utils,weblogic100tp,
workshop100tp
Some files:
license.bea, registry,registry,UpdateLicense
Now, plz guide me where I can find the lib directory? and then jar file?
Thankx -
Package javax.servlet.http does not exist
Hello All,
A few problems here
1. My classpath doesnt seem to work.:
.;"C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar"
2. As a result, i get many errors in my simple code, but there are still a few that are not related to javac not recognizing the servlet api.
I also tried setting the classpath at the command line (event hough its temporary)
set classpath="C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar"
but the servlet package is still not recognized
I have 2 classes, one to read the database connection details from a file and another class, my servlet.
Servlet Code:
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class CustomQuery extends HttpServlet
public void init() throws ServletException
EstablishDBConnetion.establishConnection();
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
response.setContentType("text/html");
PrintWriter printer = new response.getWriter();
String title = "Result from custom query";
Statement stmt = EstablishDBConnetion.establishConnection.con.createStatement();
ResultSet rs = stmt.executeQuery("select customerID from customer");
while(rs.next())
printer.println("<html> <head><title>" + title + "</title><br><br><table border=\"0\"> <tr><td>" + rs.getString(1));
rs.close();
stmt.close();
EstablishDBConnetion.establishConnection.con.close();
Database connection code
import java.io.*;
import java.sql.*;
import java.util.StringTokenizer;
class EstablishDBConnetion
public static void establishConnection()
try
String dbDriver = "";
String dbUrl = "";
String dbName = "";
String dbUser = "";
String dbPassword = "";
String newLine = "";
BufferedReader fileRead = new BufferedReader(new FileReader("connection.txt"));
boolean readerStatus = fileRead.ready();
newLine = fileRead.readLine();
while (readerStatus)
StringTokenizer st = new StringTokenizer(newLine, ",");
while (st.hasMoreTokens())
dbDriver = st.nextToken();
dbUrl = st.nextToken();
dbName = st.nextToken();
dbUser = st.nextToken();
dbPassword = st.nextToken();
readerStatus = fileRead.ready();
Class.forName(dbDriver);
String url = dbUrl + dbName;
System.out.print(url);
Connection con = DriverManager.getConnection(url, dbUser, dbPassword);
catch (IOException e)
System.out.println("IO exception in establishConnection()");
e.printStackTrace();
catch (java.lang.Exception ex)
System.out.println("General exception in establishConnection()");
ex.printStackTrace();
public static void main(String[] args)
//EstablishDBConnetion edbc = new EstablishDBConnetion();
establishConnection();
}also, full error list below
CustomQuery.java:4: package javax.servlet does not exist
import javax.servlet.*;
^
CustomQuery.java:5: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
CustomQuery.java:7: cannot find symbol
symbol: class HttpServlet
public class CustomQuery extends HttpServlet
^
CustomQuery.java:10: cannot find symbol
symbol : class ServletException
location: class CustomQuery
public void init() throws ServletException
^
CustomQuery.java:16: cannot find symbol
symbol : class HttpServletRequest
location: class CustomQuery
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
^
CustomQuery.java:16: cannot find symbol
symbol : class HttpServletResponse
location: class CustomQuery
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
^
CustomQuery.java:16: cannot find symbol
symbol : class ServletException
location: class CustomQuery
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
^
CustomQuery.java:19: package response does not exist
PrintWriter printer = new response.getWriter();
^
CustomQuery.java:24: cannot find symbol
symbol : variable establishConnection
location: class EstablishDBConnetion
Statement stmt = EstablishDBConnetion.establishConnection.con.createStatement();
^
CustomQuery.java:39: cannot find symbol
symbol : variable establishConnection
location: class EstablishDBConnetion
EstablishDBConnetion.establishConnection.con.close();
^
10 errors
I appreciate your help
Message was edited by:
paulchwd
null
Message was edited by:
paulchwdThe library is in tomcat/common/lib, not in tomcat/lib.
-
Package javax.servlet does not exist - settings appear to be correct
laugh as I write this post...it's hardly a "new topic."...but everything seems set just as it should be...
Okay...I'm a seasoned programmer in every language but JAVA. Here's the issue...every time I try to use the Core Servlets book/website by Marty Hall and Larry Brown I get hung up on the packages. This time, I downloaded and followed step by step what the website said to do...it was even preconfigured for me! Alas...I am getting the following compliation errors on a "simple packagless" program with NetBeans:
Compiling 1 source file to C:\Servlets+JSP\HelloServlet\build\classes
C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:2: package javax.servlet does not exist
import javax.servlet.*;
C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;
C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:13: cannot find symbol
symbol: class HttpServlet
public class HelloServlet extends HttpServlet {
C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:14: cannot find symbol
symbol : class HttpServletRequest
location: class HelloServlet
public void doGet(HttpServletRequest request,
C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:15: cannot find symbol
symbol : class HttpServletResponse
location: class HelloServlet
HttpServletResponse response)
C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:16: cannot find symbol
symbol : class ServletException
location: class HelloServlet
throws ServletException, IOException {
6 errors
BUILD FAILED (total time: 0 seconds)
These are my environment settings (note that the JAVAX package is located under the src folder in Java)
Catalina Home:
C:\apache-tomcat-6.0.10
CLASSPATH:
C:\apache-tomcat-6.0.10\lib\servlet-api.jar;
C:\apache-tomcat-6.0.10\lib\jsp-api.jar;
C:\apache-tomcat-6.0.10\lib\el-api.jar;
C:\Servlets+JSP;..;..\..;
C:\Program Files\Java\jdk1.6.0_03\src
JAVA_HOME
C:\Program Files\Java\jdk1.6.0_03
Path:
C:\Program Files\Java\jdk1.6.0_03\bin;%PATH%
Any ideas (excluding the one that maybe I should let my hair grow out, put on some tackey shorts and sandles and start palying an instrument in the streets of Austin for living?)cabkats wrote:
You are then suggesting that I make the corrections directly to the files in apache using notepad instead of using the envir. variables?No I am not suggesting that. I am suggesting that you need to read the documentation about the product(s) and set them up the way they require, rather than blindly think that the CLASSPATH environment variable is some magical entity.
I will try this, but I was hoping that since my IDE auto configured (with exception to java_home) that I would not have to do this. I wil give it try....thanks for the suggestion.See, you're using an IDE. Like I mentioned, IDEs do not use the CLASSPATH environment variable. You need to set up your project in your IDE in such a way that it knows what the dependent jars are. I'm sure there's a way to add jars to your project's dependencies. -
Problem: package javax.servlet.jsp does not exist
I am a novice JSP programmer. My projects that use any javax.servlet classes are not seeing those at all. I am working with a group of folks using Java SE 1.5. (Note: I'm using Windows so the directory separator is "\")
What Used to work:
1. Nearly all my projects were working using Java version 1.6. These projects were developed as examples from Wrox and Apress books about JSP and Struts.
What has changed:
1. I un-installed the version 1.6 of JDK and JRE, as well as tomcat, netbeans, and all the associated libraries/jars.
2. I installed version 1.5 of JDK and JRE, as well as tomcat, netbeans, and all the associated libraries/jars.
3. I updated my JAVA_HOME, CATALINA_HOME, CLASSPATH, and PATH environmental variables. I made sure that the path to servlet-api.jar (in the tomcat common\lib) is included in the classpath.
What is wrong:
1. References to javax.servlet.* are not satisfied--they are flagged in the source code in NetBeans and I get compiler errors with any project containing those references. For example:
... package javax.servlet.jsp does not exist
import javax.servlet.jsp.*;
What I've found:
1. My CATALINA_HOME=C:\Java\Tomcat 5.5
2. My JAVA_HOME=C:\Java\jdk1.5.0_11
3. My CLASSPATH=.;C:\Program Files\QuickTime\QTSystem\QTJava.zip;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib;%JAVA_HOME%\lib\jsp-api.jar;%CATALINA_HOME%\common\lib\servlet-api.jar;C:\Java\logging-log4j-1.2.14\dist\lib\log4j-1.2.14.jar
4. My PATH=c:\wint\BIN;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;%CATALINA_HOME%\bin;C:\MySQL\MySQL Server 5.0\bin;D:\MiKTeX 2.5\miktex\bin;C:\Perl\bin\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\SFU\Perl\bin\;C:\SFU\common\;C:\Program Files\Lahey-Fujitsu Fortran\v7.1\Bin;C:\Program Files\Lahey-Fujitsu Fortran\v7.1\Win32\Bin
What I need:
1. I need to have some reference to the servlet classes satisfied in my configuration. Any help is appreciated.
thanks
jondrOh. I got some over-the-shoulder debug help.
My error was in the classpath specification:
The path: %JAVA_HOME%\lib\jsp-api.jar
Should be: %CATALINA_HOME%\lib\jsp-api.jar
That contains the javax.servlet.jsp.*
Thimk.
Message was edited by: jon
jondr -
Error: package javax.servlet.http does not exist
Hi all,
How do I import javax.servlet?
package com.example.web;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class BeerSelect extends HttpServlet {
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
response.setContentType("text/html");
PrintWriter out = response.getWrite();
out.println ("Beer Selection Advide<br>");
String c = request.getParameter("color");
out.println ("<br>Got beer color " + c);
}What does this error mean? The error message:
Compiling 1 source file to C:\Program Files\Apache Software Foundation\MyProjects\J2EE\build\classes
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:3:
package javax.servlet does not exist
import javax.servlet.*;
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:4:
package javax.servlet.http does not exist
import javax.servlet.http.*;
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:7:
cannot find symbol
symbol: class HttpServlet
public class BeerSelect extends HttpServlet {
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:8:
cannot find symbol
symbol : class HttpServletRequest
location: class com.example.web.BeerSelect
public void doPost(HttpServletRequest request,
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:9:
cannot find symbol
symbol : class HttpServletResponse
location: class com.example.web.BeerSelect
HttpServletResponse response)
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:10:
cannot find symbol
symbol : class ServletException
location: class com.example.web.BeerSelect
throws IOException, ServletException {
6 errors
BUILD FAILED (total time: 0 seconds)Thank you.Hi,
The file servlet-api.jar / servlet.jar is not available in your classpath.
To compile an Servlet you need the jar file to be in classpath.
The jar file can be found in your webserver / application server lib folder.
Regards,
Zack -
ANT script genrated error: package javax.servlet does not exist
Hi there,
I am running ANT and confronted this message:
[javac] Compiling 1 source file to C:\eclipseProjects\tomcat_test
[javac] C:\eclipseProjects\tomcat_test\WEB-INF\src\WebTest.java:4: package javax.servlet does not exist
[javac] import javax.servlet.ServletException;
[javac] ^I googled around and found this solution:
servlet-api.jar is the jarfile that contains javax.servlet.ServletException and javax.servlet.http.* which are imported by WebTest.java and must therefore be found in the classpath. If javac doesn't find this jar (or the javax.servlet packages), it will say (or shout, depending on my and javac's mood): [the error message]
well...I set in the classpath the location of the servlet-api.jar
(found at: C:\Tomcat\common\lib)
I set it with the environment variable (windows xp)
Just as it's shown here: http://www.cs.usask.ca/~wew036/latex/env-env.jpg
NOTHING :-(
could anyone assist, thanksHi..seems u r new to J2ee.. dont worry its a very small problem:
Here is the solution.. yes u have to edit the environment variables:..
I am using J2EE sdk 1.4 and running on xp
This is the classpath setting:
C:\Sun\AppServer\lib\j2ee.jar;
This is the PATH setting
C:\Sun\AppServer\bin;
Good Luck :) -
ATMTag.java:5: package javax.servlet does not exist
My j2ee jdk1.4.2 is not supporting javx package.
i already set all pathh and class path.
anybody can help me.
details are given below ::
C:\AVA\J2EE Programs\JSP\JSPCustomTag>javac ATMTag.java
ATMTag.java:5: package javax.servlet does not exist
import javax.servlet.*;
^<br>
ATMTag.java:6: package javax.servlet.http does not exist
<br>
import javax.servlet.http.*;
<br>
ATMTag.java:18: cannot resolve symbol
symbol : class TagSupport
location: class ATMTag
public class ATMTag extends TagSupport{
<br> ^
ATMTag.java:29: cannot resolve symbol
symbol : class JspTagException
location: class ATMTag
public int doStartTag() throws JspTagException{
<br> ^
ATMTag.java:31: cannot resolve symbol
symbol : class JspWriter
location: class ATMTag
<br> JspWriter out =pageContext.getOut();
^
ATMTag.java:31: cannot resolve symbol
symbol : variable pageContext
location: class ATMTag
<br> JspWriter out =pageContext.getOut();
^
ATMTag.java:56: cannot resolve symbol
symbol : variable pageContext
location: class ATMTag
pageContext.getOut().write(str);
<br> ^
ATMTag.java:60: cannot resolve symbol
symbol : variable EVAL_PAGE
location: class ATMTag
return EVAL_PAGE;
^
8 errorsWhen compiling servlets etc, you need to include in your classpath a jar file with all the javax.* classes defined in it.
For Tomcat this is called servlet.jar and is in (I think) [TOMCAT_HOME]/shared/lib or /common/lib
For J2EE 1.4 Server, the jar is [J2EE_HOME]/lib/j2ee.jar
Where the _HOME directory is the directory where you installed J2EE.
Include this jar file in your classpath when compiling.
Good luck,
evnafets -
Package javax.servlet.jsp does not exist.
dear all!
I've one program which import javax.servlet.jsp.* as one of the package to be used in
the program, and I am using j2sdk 1.4.0_01 to compiled it.
However I got this error message : package javax.servlet.jsp does not exist.
Where does it wrong?.
error message like :
logisticslib.java:6: package javax.servlet.jsp does not exist
import javax.servlet.jsp.*;
^
logisticslib.java:201: cannot resolve symbol
symbol : class JspWriter
location: class elogistic.db.logisticslib
public void getServiceInfo(JspWriter out, String SQL) {You need a J2EE implementation, I recomemend Tomcat, you also need to put the .jar w/ the implementation in in your classpath.
-
Package javax.servlet does not exist, package javax.servlet.http does not
Dear All,
I am a newbie to JAVA.
I installed JDK1.6.0_04, then NetBeans IDE 6.0
I tried compiling an example servlet, but got this error message:
package javax.servlet does not exist, package javax.servlet.http does not exist
I tried locating these packages, but in vain. I also tried setting the CLASSPATH to many values, still it did not work.
Can anyone, please, help me with this.
Should I be able to see/locate these packages, do I have to download them?
Thank you very much.davidgoodman wrote:
Dear All,
I am a newbie to JAVA.
I installed JDK1.6.0_04, then NetBeans IDE 6.0
I tried compiling an example servlet, but got this error message:
package javax.servlet does not exist, package javax.servlet.http does not exist
What servlet/JSP engine do you plan to deploy to? Tomcat, perhaps?I think it's Tomcat (C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.14). Are there other engines that come with NetBeans IDE 6.0 (when I downloaded NetBeans, I chose ALL)
>
If so, you'll need to put the servlet JAR in your CLASSPATH. (servlet-api.jar for Tomcat 5.5 and earlier, servlet.jar for 6.0 >and later.)
I tried locating these packages, but in vain.
You won't find them until you realize that you have to deploy that servlet someplace.How to deploy?
I also tried setting the CLASSPATH to many values, still it did not work.
See above. What were you planning to set CLASSPATH to?First I set to:
C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.14\lib (because I found jar named servlet-api.jar in this folder)
Later I added this:
C:\Program Files\Java\jdk1.6.0_04\lib (out of trial-and-fail)
Finally I added some paths that lead to a library such as
C:\Program Files\glassfish-v2\lib
C:\Program Files\glassfish-v2\lib\ant\lib
Can anyone, please, help me with this.
Should I be able to see/locate these packages, do I have to download them?
You have to get a servlet/JSP engine. Step 1.Thank you for your help -
Why I got package javax.servlet.http do not exist
I have package javax.servlet.http do not exist problem, can anyone tell me why?
Thank youHi all
Thank you for all kinds of replies. It is Windows problems. but I got a new questions here
1) it seems I don't need to including
install_dir\common\lib\jsp-api.jar in classpath!!
2) when I try servletUtilities,
from http://www.coreservlets.com/Apache-Tomcat-Tutorial/#Configure-Tomcat
I got error
HelloServlet3.java:23: cannot resolve symbol
symbol : variable ServletUtilities
location: class coreservlets.HelloServlet3
out.println(ServletUtilities.headWithTitle(title) +
^
1 error
both my HelloServlet3 and servletUtilities under
WEB-INF\classes\coreservlets
thank you -
Package javax.servlet.http does not exists
Hi,
I am new to J2EE and am writing my first servlet. I tried to compile a servlet I wrote and got the following error.
"package javax.servlet.http does not exists".
What do i do to correct this error?
Also is there any links which has a complete servlet tutorial.
Please advice
ThanxMost probably you need to include the servlet-api library in your classpath when compiling.
You should find this file in the lib directory of your container.
It will be called servlet-api.jar (Tomcat) or j2ee.jar (Suns J2EE server) or something along those lines.
The j2ee tutorial is a decent place to start learning about servlets...
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
Good luck,
evnafets -
Package javax.servlet doest not exist
Hi,
I just started to learn servlets. But when I am trying to compile my first program, which is HelloServlet , I am getting compilation error saying that Package javax.servlet does not exist, package javax.servlet.http does not exist.
I am using j2sdk version 1.4.2_04 and Tomcat 5 .
I set the classpath and it looks like this
set CLASSPATH=.; C:\ServletPrograms;C:\Tomact\common\lib\servlet-api.jar;C:\Tomcat \common\lib\jsp-api.jar
I stored my servlet program in C:\ServletPrograms directory.
Can any body please help with this?????I just started to learn servlets. But when I am trying to compile my first program, which is HelloServlet , I am getting compilation error saying that Package javax.servlet does not exist, package javax.servlet.http does not exist.The OP is attempting to compile.
I set the classpath and it looks like this
set CLASSPATH=.; C:\ServletPrograms;C:\Tomact\common\lib\servlet-api.jar;C:\Tomcat \common\lib\jsp-api.jarThe OP is also attempting to set the classpath but notice that here the path to the servlet-api.jar has Tomcat mis-spelled. Is this the actual classpath or a typo when posting the question? -
Package javax.servlet does not exists - Cannot resolve symbol
Hello,
I am using JDK 1.3.1.06 version. I wanted to compile a simple servlet using this. But I am getting plenty of errors for all javax package. Why it is not able to find javax package classes?
The following is the program I have tried to compile.
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class TestServlet extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
process(request, response);
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
process(request, response);
private void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
PrintWriter out = response.getWriter();
out.println("Hello World !");
I am getting errors like this :
Package javax.servlet does not exists.
cannot resolve symbol
symbol : class HttpServlet
Please advice me some solutions fast.
Thanking you,
ForumAns.javax.servlet doesn't come with the standard jdk. It's part of J2EE.
If you have tomcat, you can use the server.jar that comes with tomcat.
Or you can just download J2EE sdk instead.
I am getting errors like this :
Package javax.servlet does not exists.
cannot resolve symbol
symbol : class HttpServlet -
Package javax.servlet does not exists ?
Hello,
I am using JDK 1.3.1.06 and trying to compile a simple Servlet. But getting errors as javax package classes does not exits and cannot resolve symobol.
The following is the program I am trying to compile:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class TestServlet extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
process(request, response);
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
process(request, response);
private void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
PrintWriter out = response.getWriter();
out.println("Hello World !");
I am getting errors such as :
Package javax.servlet does not exists.
cannot resolve symbol
symbol : class HttpServlet
Please advice me of any solution asap. Deep trouble.
Thanking you,
Forumans.Just a guess...
JDK 1.3.1.06 This represents the Java language in the form of a JVM and the Java API (like java.lang.String.)
ServletThis is in J2EE, which if you look above was not mentioned.
If you look in the java docs for the JDK you will also find that javax.servlet does not exist.
I would guess however that you could start here - http://java.sun.com/j2ee/
However, keep in mind that your servlet still needs to run in something, so you better make sure that you are compiling against the correct J2EE server for what you are doing.
Maybe you are looking for
-
My appswont download it keeps coming up payment declined even though I tried all bank cards and rang the bank they say there is nothing wrong with my card everytime I go to download I sign in and it asks for payment details then say its declined plea
-
Since installing the latest update firefox stops responding and hangs during use.
The only way I can get it to work is to shut it down and restart the application. I can open IE and access the sites which don't respond so it is definately a firefox problem. All firefox tabs stop responding including downloads. This is occurring ev
-
From iPhone 4 to iPhone 5?
Hi to all! How can I move all my programs and games from iPhone 4 to iPhone 5?
-
Link button to User Defined Object in Grid
Hi, I'm using SAP B1 8.81 with B1DE. I have added a grid which is populated from a DataTable to a form. One of the columns in the grid contains the DocEntry of a User Defined Object. How can I display a link button on the grid ? Regards, Ben
-
Why is FlashPlyer crashing?
For goodness sake ????? 48 hours and flash is still crashing everytime I try to play a game of Facebook. NOT good enough!!!!! Using Chrome, have done all the checks and am told by Adobe test that I have the latest and greatest, yet it stopped work