tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Burak Yýlmaz <netson...@yahoo.com>
Subject Re: How to change(override) application path
Date Mon, 30 Jul 2007 16:20:05 GMT
my links to images,css,js are like below in jsp files;

/images/xxx.jpg
/js/xxx.js
/css/xxx.css

solution is fully re rewriting the url's i know like;

http://www.mydomain.com/images/xxx.jpg

But its hard to change thousands of links and i thought if it is logical or not so i looked
to a solution at container level.


----- Original Message ----
From: David Smith <dns4@cornell.edu>
To: Tomcat Users List <users@tomcat.apache.org>
Sent: Monday, July 30, 2007 7:05:47 PM
Subject: Re: How to change(override) application path

How is the jsp composing the relative urls to images and stylesheets?

I typically have jsps reference urls by doing 
${pageContext.request.contextPath}/path/to/resource.jpg for example.  
That fills in the context path and forms a site absolute path to the 
resource.  The jsp can move around and more importantly the URL to it 
can change without breaking links to resources.

--David

Burak Yýlmaz wrote:

>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@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org






       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get
online.
http://smallbusiness.yahoo.com/webhosting 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message