• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

context path

 
rahul karwal
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....

 
rahul karwal
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried that it didn't work, any other way?
pls help
thanks
aziz dhanani.
 
Ajith Anand
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would cross-check the configuration of the context path in this case.
 
rahul karwal
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may do like this if the references are made from a JSP.....


[ November 16, 2004: Message edited by: Ajith Anand ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic