Hello Faisal,
I also posted a similar question in the "Displaying Records from the Database with Java Servlets" tutorial. I'm new to Java and needed some help, and have found your site in my search for learning JSP.
I'm having a hard time figuring out how to work on the "Displaying Records" tutorial after having installed Tomcat 6.0 using this tutorial.
I have two questions, but let me explain my set up before I ask them.
Now, after I completed this tutorial, my Tomcat is now installed here:
C:\apache-tomcat-6.0.14\
I set the JAVA_HOME and CATALINA_HOME variables as you said:
CATALINA_HOME : C:\apache-tomcat-6.0.14
JAVA_HOME : C:\Program Files\Java\jdk1.6.0_03
When I make the "Hello Faisal Khan" index.jsp page, I put it in:
C:\apache-tomcat-6.0.14\webapps\star
and I run it here:
http://localhost:8080/star/
That runs fine.
So knowing that this is my setup...
I'm following your "Displaying Records from the Database with Java Servlets" tutorial... and it's saying to create a DisplayServlet.java file and place it in:
/APP_NAME/WEB-INF/classes/com/stardeveloper/servlets/db/
So for me, I'm thinking I should put this in:
C:\apache-tomcat-6.0.14\webapps\star\WEB-INF\classes\com\stardeveloper\servlets\db
However, when I go to the page you say to go to:
http://localhost:8080/star/servlet/com.stardeveloper.servlets.db.DisplayServlet
I'm getting a:
The requested resource (/star/servlet/com.stardeveloper.servlets.db.DisplayServlet) is not available.
So my two questions are this:
1) Am I placing the DisplayServlet.java file where I'm supposed to?
2) Am I supposed to compile the DisplayServlet.java file prior to running the link you said? If I am supposed to compile first, using javac, I keep getting an error about package javax.servlet and package javax.servlet.http not existing. I believe I need to do something with the Tomcat provided servlet-api.jar file, but I'm not sure what exactly.
Could you (or anyone) please help me?