Tomcat

I have a WebApplication that is currently running on Tomcat 4 JDK 1.4. As part of upgrade, I am upgrading the WebApplication to be running on Tomcat 6 using JDK 1.5, everything is working and all good except for the following issue:
 
  I am using Login-Form <Form> authentication defined in the web.xml of my WebApp. In tomcat 4, when the user click on my myweb/service/main.jsp, the user basically gets redirected to common/login/login.jsp (defined in web.xml) after authentication the user basically goes back to myweb/service/main.jsp and all good. In tomcat 6, the login.jsp page, residing in myweb/common/login/ path, being retrived from where user is being asked for authentication.
 For example, assume a user is at myweb/service/canada/view.jsp then session timed out so the user will be prompted with login page, however, the login page does not get displayed properly (i.e. css and images not being loaded from myweb/images/) because tomcat is trying to retreive the login.jsp relative to where is being prompted with login, myweb/service/canada, and not from the webapp/ root directory.

 Any idea to fix this issue ?
fylix0000Asked:
Who is Participating?
 
rrzConnect With a Mentor Commented:
I meant
<img src="<%=request.getContextPath()%>/images/logo.gif" />
0
 
rrzCommented:
You could use server-relative paths.  For example,
<img src="<%=request.getContextPath()%>/images.logo.gif" />
0
 
fylix0000Author Commented:
that did it man. thanks
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Yes, that's usually the right way to do it so that you can keep moving your pages around and the paths will still work
0
 
fylix0000Author Commented:
Thanks for the feedback guys.
0
All Courses

From novice to tech pro — start learning today.