Tomcat and JSP file locations

S

Sjaak

Hi All,

(First I would like to say I'm very new to JSP development)

I have installed Tomcat 5.5.6 and the examples work fine.

--- hello.jsp ---
<HTML>
<HEAD><TITLE>JSP Test</TITLE></HEAD>
<BODY BGCOLOR="#FDF5E6">
<H1>JSP Test</H1>
Time: <%= new java.util.Date() %>
</BODY></HTML>
--- hello.jsp ---

If I place this file in C:\Tomcat\webapps\ROOT it is not found.
If I place it in C:\Tomcat\webapps\jsp-examples it does work.!!

When I make a directory in C:\Tomcat\webapps for example
C:\Tomcat\webapps\test the directory is not found.

How come? Do I have to configure something? If so where and what?

Thank you very much!!

Also anybody know of a good website for .JSP nitwits like me?

Kind regards,
Steven.
 
H

Heiner Kücker

Sjaak wrote
(First I would like to say I'm very new to JSP development)

I have installed Tomcat 5.5.6 and the examples work fine.

--- hello.jsp ---
<HTML>
<HEAD><TITLE>JSP Test</TITLE></HEAD>
<BODY BGCOLOR="#FDF5E6">
<H1>JSP Test</H1>
Time: <%= new java.util.Date() %>
</BODY></HTML>
--- hello.jsp ---

If I place this file in C:\Tomcat\webapps\ROOT it is not found.
If I place it in C:\Tomcat\webapps\jsp-examples it does work.!!

When I make a directory in C:\Tomcat\webapps for example
C:\Tomcat\webapps\test the directory is not found.


The webapps sub directory is the name of the jsp application.


C:\Tomcat\webapps\test\hello.jsp

call with

http://localhost:8080/test/hello.jsp

in browser

--
Heiner Kuecker
Internet: http://www.heinerkuecker.de http://www.heiner-kuecker.de
JSP WorkFlow PageFlow Page Flow FlowControl Navigation: http://www.control-and-command.de
Java Expression Formula Parser: http://www.heinerkuecker.de/Expression.html
CnC Template Technology http://www.heinerkuecker.de/Expression.html#templ
 
R

Ryan Stewart

Sjaak said:
Hi All,

(First I would like to say I'm very new to JSP development)

I have installed Tomcat 5.5.6 and the examples work fine.

--- hello.jsp ---
<HTML>
<HEAD><TITLE>JSP Test</TITLE></HEAD>
<BODY BGCOLOR="#FDF5E6">
<H1>JSP Test</H1>
Time: <%= new java.util.Date() %>
</BODY></HTML>
--- hello.jsp ---

If I place this file in C:\Tomcat\webapps\ROOT it is not found.
If I place it in C:\Tomcat\webapps\jsp-examples it does work.!!
This is not right unless there is a change between 5.5.4 and 5.5.6. Place
whatever.jsp in the ROOT directory, and access it as
http://localhost:8080/whatever.jsp (assuming the default port).
 
G

gimme_this_gimme_that

You configure this information in a Context xml tag in
$CATALINA_HOME/conf/server.xml
 
R

Ryan Stewart

You configure this information in a Context xml tag in
$CATALINA_HOME/conf/server.xml
That is not recommended in Tomcat 5. Each context should go in its own XML file
in $CATALINA_HOME/conf/Catalina/localhost (or your host).
 
C

Chris Riesbeck

Ryan Stewart said:
That is not recommended in Tomcat 5. Each context should go in its own XML file
in $CATALINA_HOME/conf/Catalina/localhost (or your host).

And if you're making a WAR, put the XML context fragment
in the META-INF directory and Tomcat will deploy it automatically
to the host subdirectory.

And it appears that Tomcat 5.5 also looks for META-INF XML
files even in regular directories not packed into WAR's.
 
R

Ryan Stewart

Chris Riesbeck said:
And if you're making a WAR, put the XML context fragment
in the META-INF directory and Tomcat will deploy it automatically
to the host subdirectory.

And it appears that Tomcat 5.5 also looks for META-INF XML
files even in regular directories not packed into WAR's.

That's one method I've never tried. Thanks for the tip.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top