Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / August 2006

Tip: Looking for answers? Try searching our database.

Tomcat 5.x and Document Root

Thread view: 
alasdair.dougall@gmail.com - 16 Aug 2006 13:48 GMT
Hi,

Sure this is a simple question, but I have an War File (ROOT.war),
which expands to the Root directory, and is available under
http://myserver.com/cart.jsp.  Internally, the file was set up to have
images tags like <img src="/images/cash.jpg"....../>.

Anyway, I have to move where it lives.  It is been installed into a
sub-directory, and I find that when I call
http://myserver.com/ShoppingCart/cart.jsp, I get an error because
/images/cash.jpg does not exist.

How should I set up the Context to allow me to use the cart.jsp, with
its /images/cash.jpg image tag without having to change them to
/ShoppingCart/images/cash.jsp?  (Reason is there are hundreds of
references and it will change again once implemented into different
sites.)

Thanks in advance,

Alasdair
Rohit Kumbhar - 16 Aug 2006 14:18 GMT
> Hi,
>
[quoted text clipped - 10 lines]
> its /images/cash.jpg image tag without having to change them to
> /ShoppingCart/images/cash.jsp?

Add the <base> tag to the jsp with the url value as the contextRoot +
"ShoppingCart"

 (Reason is there are hundreds of
> references and it will change again once implemented into different
> sites.)

Best way, deploy it as an application on its own!

> Thanks in advance,
>
> Alasdair


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.