Hi experts,
I'm experience in pure java programing but not JSP or Servlet.
Now, I want to develop a web by using JSP. I chose tomcat as the server.
I'm novice to tomcat although I ever used version 3.3 before, but never deeply understand how it works ;-)
I've downloaded tomcat-5.0.27 installer and installed on my computer, WinXp pro with JDK1.4.2, at D:\tomcat-5.0.27.
I've set these variables:
CATALINA_HOME=d:\tomcat-5.
0.27
JAVA_HOME=C:\j2sdk1.4.2
CLASSPATH=.;C:\j2sdk1.4.2\
lib;d:\Tom
cat-5.0.27
\common\li
b\servlet-
api.jar
PATH=%SystemRoot%\system32
;%SystemRo
ot%;C:\j2s
dk1.4.2\bi
n
Then, I created a folder D:\Project\esp as my virtual directory for my webapp. So, my index.jsp should be placed here.
After that, I created a file at d:\tomcat-5.0.27\conf\Cata
lina\local
host\esp.x
ml with following stuff:
<Context path="/esp" docBase="D:\Project\esp" debug="0" reloadable="true"/>
Later, I created my web pages, one is D:\Project\esp\index.jsp, that linked with images and stylesheets.
Here is the structure
D:\Project
+----esp
+----index.jsp
+----images
| +----*.gif,*.jpg
+----style.css
+-----test
+----test.jsp
Finally, I restarted the server, via Monitor Tomcat, and access my web page with url
http://localhost:8080/esp.
The page is loaded fine except images did not show in the page. Not only that, I've tested by create a page, test.jsp, at
the path I specified above and access it with url
http://localhost:8080/esp/test/test.jsp . It shows me this error:
HTTP Status 404 - /test/test.jsp
--------------------------
----------
----------
----------
----------
----------
----
type Status report
message /test/test.jsp
description The requested resource (/test/test.jsp) is not available.
--------------------------
----------
----------
----------
----------
----------
----
Apache Tomcat/5.0.27
What I want to know are:
Did I miss something?
How can I access web pages and images inside sub-directory of web root?
What's the general process to write a webapp using JSP with tomcat?
I'm using Editplus as a JSP Editor.
Regards,
G noon