Hi,
in the
I am trying to run my first
servlet prgoram, but in vain. I will give the full details what I am trying to do.
I am using Head First Servlets &
JSP Book. And I followed the example given in that book.
All the below things are tried in Windows 98 SE (PC, not in network)
--------------------------------------------------------------------
I am using JDK1.5, which is in C:\JDK1.5
I am using
Tomcat 5.0.38, which is in C:\Tomcat
Environment Variables
-----------------------
I am setting my environment variables in the autoexec.bat:
SET PATH=C:\JDK1.5\bin\;%PATH%
SET JAVA_HOME=C:\JDK1.5
SET CATALINA_HOME=c:\Tomcat
SET CLASSPATH=.;c:\Tomcat\common\lib\servlet-api.jar;c:\Tomcat\common\lib\jsp-api.jar;%CLASSPATH%
My development Folder details
-------------------------------
D:\Head\MyProjects\beerv1\classes
D:\Head\MyProjects\beerv1\etc
D:\Head\MyProjects\beerv1\lib
D:\Head\MyProjects\beerv1\src
D:\Head\MyProjects\beerv1\web\form.html (Html file is kept here)
D:\Head\MyProjects\beerv1\src\com\example\model
D:\Head\MyProjects\beerv1\src\com\example\web\BeerSelect.java (Servlet file is kept here)
My Deployment folder details
-------------------------------
C:\Tomcat\webapps\Beer-v1\WEB-INF\form.hmtl (HTMl file is kept here)
C:\Tomcat\webapps\Beer-v1\WEB-INF
C:\Tomcat\webapps\Beer-v1\WEB-INF\classes
C:\Tomcat\webapps\Beer-v1\WEB-INF\classes\com\example\web
C:\Tomcat\webapps\Beer-v1\WEB-INF\classes\com\example\model
C:\Tomcat\webapps\Beer-v1\WEB-INF\lib
C:\Tomcat\webapps\Beer-v1\WEB-INF\web.xml (xml file is kept here)
PROBLEM !!!
---------------
If I am compiling the below one,
D:\Head\MyProjects\beerv1\src\com\example\web>javac BeerSelect.java
It is compiling and the class file is created.
If I want to compile this file in the package, it showing error like
"import javax.servlet.*" package doesn't exists
I know something wrong with the classpath.
What are all the things needs to be set in the classpath.
I have set for servlet-api.jar and jsp-api.jar. Other than that we have to set any other thing.
I have given all the folder structure above. please suggest how to set the classpath correctly so that while compiling the BeerSelect.java its class(BeerSelect.class) should be automatically placed in "C:\Tomcat\webapps\Beer-v1\WEB-INF\classes\com\example\web"
I have web.xml file, form.html file and BeerSelect.java Servlet file. There is no problem with these files. I think it is because of classpath issue. I have referred lots resources for classpath, but I couldn't make it success.
Thanks in advance,
Niyas.