Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

How to change(override) application path

netsonic netsonic

2007-07-30

Replies:

My question is related with java but i think the solution is at the tomcat global variables so i need this groups help.

I want my web links to be like www.mydomain.com/album/13

with the help of the front controller at java i will translate the url to www.mydomain.com/album.jsp?id=3 and dispatch it to the jsp file...

at web.xml i configured the url pattern like below

<servlet>
 <servlet-name>Controller</servlet-name>
 <servlet-class>com.mydomain.Controller</servlet-class>
</servlet>

<servlet-mapping>
 <servlet-name>Controller</servlet-name>
 <url-pattern>/album/*</url-pattern>
</servlet-mapping>


Everything is ok if i type the url like mydomain.com/album

But
if i type mydomain.com/album/ or mydomain.com/album/13 my pages are
displayed but the images,css files,js files cannot be imported....This
is because application tries to get the images from like
mycontext/album/images/xxx.gif but in fact the images are under
mycontext/images/xxx.gif


Because of this urlrewriting i have this path problem...So there must be some option i will re set exmp: TOMCAT.Application.Path="http://www.mydomain.com/" everytime after recreation of real url and my images and other files will be displayed correctly.

thank you

Burak




   
____________________________________________________________________________________
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more.
http://mobile.yahoo.com/go?refer=1GNXIC

---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.