Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat paths

Status
Not open for further replies.

forrozeiro

Programmer
Sep 1, 2001
38
BR
Hi,

I've deployed an application in tomcat 3.2.3, organized like this:

style/
js/
images/
jsp/
WEB-INF/...

The application dir under webapps is called cfg. I have some includes (<jsp:include>) and forwards (<jsp:forward>), like this:

...page=&quot;/cfg/jsp/a.jsp&quot;

This includes and forwards are leading to &quot;page not found&quot; errors, because tomcat looks for pages like:

/cfg/cfg/jsp/a.jsp

Notice that cfg appeared twice and obvously there is no subdirectory cfg under webapps/cfg.
I have reasons for not changing my HREFs, that is, I must have ...page=&quot;cfg/jsp/a.jsp&quot;.

Any help ?? Some tomcat specific configuration perhaps ??

Thank you in advance,
forrozeiro.
 
Well here is the deal the root of the Web Application (aka /) is the directory in which the Web App resides in, in this case cfg. This is so the application is not dependent on the name of the root directory.

So your structure is:
Code:
cfg/
 \_
   style/
 \_
   js/
 \_
   images/
 \_
   jsp/
 \_
   WEB-INF/
    \_
      web.xml
    \_
      classes/
You have only two choices, change the links by taking out the cfg reference OR placing out directories except WEB-INF in another directory named cfg under the root cfg application.

Now your structure would be:
Code:
cfg/
 \_
   cfg/
    \_
      style/
    \_
      js/
    \_
      images/
    \_
      jsp/
 \_
   WEB-INF/
    \_
      web.xml
    \_
      classes/
Wushutwist
 
Could you possibly try an url-mapping to collapse any references to cfg/ to /

*shrug* I'll admit I am relatively naive in the ways of servlets/tomcat, but I've seen such quasi-hacks to pretty up resultant URLs and make things easier for servlet referencing. (webapp/servlet/webapp/ => webapp/)

If you could somehow show us any relative parts of your server.xml or web.xml files (from tomcat or your cfg web-app) then they may help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top