You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sutiwan Kariya <Su...@tisco.co.th> on 2002/09/09 11:55:42 UTC

Relative Path Error-- Pls help!

I am using struts runs on IBM WebSphere 4.0
my web site 's name (context root) is  'td'
I got an image location error when use
<img src = "/images/general_active_tab.gif" >
or
<html:image src = "/images/address_passive_tab.gif"   border= "0"/>

But, if I tried
<img src = "/td/images/general_active_tab.gif" >
or
<html:image src = "/td/images/address_passive_tab.gif"   border= "0"/>

The image was displayed correctly
Why??????
I feel like the "/" doesn't relate to the context root. but it relate to
the root of context root.

This symptom didn't occur with the image tag only BUT It occur when I tried
to use
 <html:button property="add" onclick="window.location
= '/institutionGeneralInfo.do?action=create'"

It got an error also.
but, If I tried
 <html:button property="add" onclick="window.location
= '/td/institutionGeneralInfo.do?action=create'"
It's OK!


Please help me...
Sutiwan W.





********************************************************************
This E-mail and any files transmitted with it are confidential
and intended for the sole use of the individual or entity
to whom they are addressed. If you have received this 
E-mail in error please notify the system manager.  This E-mail
message has been swept for the presence of computer
viruses.
********************************************************************


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Relative Path Error-- Pls help!

Posted by un...@prometeo.it.
Instead of <html:img src="/images/somestuff.jpg"...
use page="/images/somestuff.jpg".

Because, as it is explained in the documentation, page will cause the tag to 
output a reference relative to the app context root.
So you'll get this in HTML: <img src="/yourappcontext/images/somestuff.jpg"> 
while you are getting this now: <img src="/images/somestuff.jpg">.

Good luck,
umberto

Quoting Sutiwan Kariya <Su...@tisco.co.th>:

> I am using struts runs on IBM WebSphere 4.0
> my web site 's name (context root) is  'td'
> I got an image location error when use
> <img src = "/images/general_active_tab.gif" >
> or
> <html:image src = "/images/address_passive_tab.gif"   border= "0"/>
> 
> But, if I tried
> <img src = "/td/images/general_active_tab.gif" >
> or
> <html:image src = "/td/images/address_passive_tab.gif"   border= "0"/>
> 
> The image was displayed correctly
> Why??????
> I feel like the "/" doesn't relate to the context root. but it relate to
> the root of context root.
> 
> This symptom didn't occur with the image tag only BUT It occur when I tried
> to use
>  <html:button property="add" onclick="window.location
> = '/institutionGeneralInfo.do?action=create'"
> 
> It got an error also.
> but, If I tried
>  <html:button property="add" onclick="window.location
> = '/td/institutionGeneralInfo.do?action=create'"
> It's OK!
> 
> 
> Please help me...
> Sutiwan W.
> 
> 
> 
> 
> 
> ********************************************************************
> This E-mail and any files transmitted with it are confidential
> and intended for the sole use of the individual or entity
> to whom they are addressed. If you have received this 
> E-mail in error please notify the system manager.  This E-mail
> message has been swept for the presence of computer
> viruses.
> ********************************************************************
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Relative Path Error-- Pls help!

Posted by "C.Bhaskaran" <ch...@wipro.com>.
Use <html:base/> tag before using any relative paths
Rgds
C.Bhaskaran

-----Original Message-----
From: Sutiwan Kariya [mailto:Sutiwan@tisco.co.th] 
Sent: Monday, September 09, 2002 3:26 PM
To: struts-user@jakarta.apache.org
Cc: sutiwan@tisco.co.th
Subject: Relative Path Error-- Pls help!


I am using struts runs on IBM WebSphere 4.0
my web site 's name (context root) is  'td'
I got an image location error when use
<img src = "/images/general_active_tab.gif" >
or
<html:image src = "/images/address_passive_tab.gif"   border= "0"/>

But, if I tried
<img src = "/td/images/general_active_tab.gif" >
or
<html:image src = "/td/images/address_passive_tab.gif"   border= "0"/>

The image was displayed correctly
Why??????
I feel like the "/" doesn't relate to the context root. but it relate to
the root of context root.

This symptom didn't occur with the image tag only BUT It occur when I
tried to use  <html:button property="add" onclick="window.location =
'/institutionGeneralInfo.do?action=create'"

It got an error also.
but, If I tried
 <html:button property="add" onclick="window.location
= '/td/institutionGeneralInfo.do?action=create'"
It's OK!


Please help me...
Sutiwan W.





********************************************************************
This E-mail and any files transmitted with it are confidential and
intended for the sole use of the individual or entity to whom they are
addressed. If you have received this 
E-mail in error please notify the system manager.  This E-mail message
has been swept for the presence of computer viruses.
********************************************************************


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>