Hi People
I've been reading the topics on
Servlets the whole day, but I still don't know why I can't get a simple servlet to work.
I am studying
Java so I'm trying an example from my book but it just won't work.
Here is what I've done:
1. Set up JAVA_HOME to C:\Program Files\Java\jdk1.5.0_01.
2. Downloaded
JBoss Application Server 4 and unzipped (jboss-4.0.5.GA.zip) to my C:\ drive.
3. I've tested that it works fine (
http://localhost:8080/).
4. I've installed JAVA EE 5(java_ee_sdk-5_01-windows-nojdk.exe).
5. Set up
JAVAEE_HOME to C:\Sun\SDK. and CLASSPATH to %JAVAEE_HOME%\lib\javaee.jar.
6. Created a java file:
NameServlet.java and saved it in (C:\Exercises\NameServlet)
7. Created a directory (C:\Exercises\NameServlet\WEB-INF\classes).
8. Comlpield the java file:
javac -d WEB-INF\classes NameServlet.java inside C:\Exercises\NameServlet at the command prompt.
9. Created a xml file:
web.xml and saved it in (C:\Exercises\NameServlet\WEB-INF).
10. Packaged the web.xml file into a war file: (
jar -cvf nameserv.war *.* at the command prompt in C:\Exercises\NameServlet ).
11. Copied the newly created
nameserv.war file into the
C:\jboss-4.0.5.GA\server\default\deploy directory.
12. Created a html file
index.html in
C:\Exercises
13. Packaged the index.html file into a war file: (
jar -cvf index.war index.html at the command prompt in C:\Exercises ).
14. Copied the newly created
index.war file into the
C:\jboss-4.0.5.GA\server\default\deploy directory.
15. Started the Jboss Server.
16. In web Browser went to
http://localhost:8080/index.
(The page displays correctly)
17. Click on NameServlet.jsp link - error message displays:
HTTP Status 404 - /index/localhost:8080/nameserv/NameServlet
--------------------------------------------------------------------------------
type Status report
message /index/localhost:8080/nameserv/NameServlet
description The requested resource (/index/localhost:8080/nameserv/NameServlet) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.20
IT JUST WON'T WORK.
Can someone please tell me what I'm doing wrong?
Thank you