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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]