- This topic has 7 replies, 2 voices, and was last updated 19 years ago by Riyad Kalla.
-
AuthorPosts
-
frantumaMemberHi,
I have a web application which I succesfully deployed to Tomcat 4.1, with MyEclipse deploy tool. I use the expanded option.
My login page is in myproj/web/jsp/login/login.jsp
and refers to a css and images in myproj/web/images/login/myImage.gif
I use a url in my login.jsp whith url:
<img src=”../../images/login/A0025.gif”>
thus relative to the position of the login page.
This works perfectly in Tomcat. I tried to deploy the same app to JBoss 4.0 which works but doesn’t show images or css becouse of bad url, as it looks for :
http://myserver:8080/images/login/myImage.gif
instead of
http://myserver:8080/myproj/images/login/myImage.gif
Web context root is set to /myproj
web root folder is /web
Any hint?
thanks
Francesco
Riyad KallaMemberFrancesco,
When you deploy to JBoss and then load up the URL in your browser, do you need to specify the /myproj web context root in the URL? JBoss just uses Tomcat as it’s web/servlet/jsp container internally, so I’m surprised you are getting different behavior.
frantumaMemberHi,
when I access the app in JBoss or Tomcat I specify the context root, thus I type
http://myserver:8080/myproj/jsp/login.jsp
my images fo the login page are located in
myproj/web/images/login
and the img tag points to <img src=”../../images/login/A0025.gif”>
If I manually type the url:
http://myserver:8080/myproj/images/login/A0025.gif
I can see the image is there
Hope you can help,
thanks
Francesco
Riyad KallaMemberFrancesco,
Given your dir structure above, your img tag should be just ../images/login/A0025.gif, that backs you up from the “jsp” dir, up one level into the “myproj” dir, and then down into the “images/login” dir.
frantumaMemberSorry,
http://myserver:8080/myproj/jsp/login/login.jsp
is my actual path for the login page and NOT
http://myserver:8080/myproj/jsp/login/login.jsp
which I mistyped…
Francesco
Riyad KallaMemberI see, very strange, and ../../ is resolving to the root of your app server instead of the /myproj dir?
frantumaMemberyes, that’s exactly the problem..
Riyad KallaMemberFrancesco,
This is a JBoss issue and unfortunately I don’t have any more suggestions for you at this time. If you change the double ../../ to just ../, does it work on JBoss and break on Tomcat?You could try asking on the JBoss forums why.
-
AuthorPosts