aspose file tools*
The moose likes Servlets and the fly likes context path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "context path" Watch "context path" New topic
Author

context path

rahul karwal
Ranch Hand

Joined: Oct 26, 2001
Posts: 73
Hi,
can you pls tell me how can i make context path configurable, ie in development environment i have name the context path PS3(ie http://localhost:8080/PS3/jsp/*.jsp), for development i have PS3, and i have images in my page but they are not showing up if i give the path like this: - <IMG SRC="/images/banner_master_new_01.jpg" WIDTH=125 HEIGHT=67 border="0">
however when i give context path it works like this: -
<IMG SRC="/PS3/images/banner_master_new_01.jpg" WIDTH=125 HEIGHT=67 border="0"></a>

so is there anyway when i can configure it to add context path automatically and when its in production i can change accordingly or is there any other way of doing it? or i have to change the path ?
thanks
aziz dhanani.
Ajith Anand
Ranch Hand

Joined: Aug 30, 2004
Posts: 40
Replace

"/images/banner_master_new_01.jpg"

with

"images/banner_master_new_01.jpg" ( The forward slash before the images is removed )

This would resolve your references relative to the context...and would work in both your development and production environments without any changes....



LXI Technologies P Ltd
[url]www.lxisoft.com[/url]
rahul karwal
Ranch Hand

Joined: Oct 26, 2001
Posts: 73
i tried that it didn't work, any other way?
pls help
thanks
aziz dhanani.
Ajith Anand
Ranch Hand

Joined: Aug 30, 2004
Posts: 40
I would cross-check the configuration of the context path in this case.
rahul karwal
Ranch Hand

Joined: Oct 26, 2001
Posts: 73
my context path looks like this: -

<Context path="/PS3" reloadable="true" docBase="D:\eclipse-SDK-2.1.2-win32\eclipse\workspace\PS3" workDir="D:\eclipse-SDK-2.1.2-win32\eclipse\workspace\PS3\work\org\apache\jsp" />

and my file is in
PS3/jsp/*.jsp
my images are in
PS3/images/*.gif

when i do the following it works: -
../images/*.gif it works
/PS3/images/*.gift it works
images/*.gift DOEST NOT WORK

thanks
aziz dhanani.
Ajith Anand
Ranch Hand

Joined: Aug 30, 2004
Posts: 40
You may do like this if the references are made from a JSP.....


[ November 16, 2004: Message edited by: Ajith Anand ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: context path
 
Similar Threads
images don't appear outside local machine
need help on Sun Java App Server 9.1
html:file tag and custom image
Image Display problem
smiley tags refusing to render