You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by javen fang <fa...@yahoo.com.cn> on 2003/10/28 16:27:51 UTC

Struts cannot support relative uri ?

Hi, all.  I am fajaven from matrix(www.matrix.org.cn)
in China.

I wonder it seems like Struts cannot support relative
uri.

In tomcat 5.0 , my webapp looks like:
tomcat/webapps/asales

Two files are:
tomcat/webapps/asales/pages/left.jsp
tomcat/webapps/asales/pages/images/logo.jpg

Normally, in left.jsp, I use logo.jpg, like this:
<img src="images/logo.jpg"/>

but if in left.jsp include struts tags, or it mapping
from struts action, then relative uri will fail, and
"absolute" uri is required:
<img src="/asales/pages/images/logo.jpg"/>

You know, relative uri cannot be used is not
convinient very much.

How can I solve this question? 

Thanks.

javen fang from matrix

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts cannot support relative uri ?

Posted by "Ruth, Brice" <br...@fiskars.com>.
Are you using the struts html:img tag?! Otherwise, if you only have <img 
src="images/logo.jpg"> in your JSP, then the HTML that is output won't 
be anything other than <img src="images/logo.jpg"> - Struts/Tomcat/or 
any other container/framework passes through any non-JSP tags like HTML 
"as is".

Send the exact HTML that is in your JSP and the exact HTML that is 
output when you load the page in a browser. Include the exact URI that 
you use to load the page, too.

javen fang wrote:

>>but if in left.jsp include struts tags, or it mapping
>>    
>>
>>from struts action, then relative uri will fail, and
>  
>
>>"absolute" uri is required:
>><img src="/asales/pages/images/logo.jpg"/>
>>    
>>
>
>If in this condition, I do like this:
><img src="images/logo.jsp"/>
>
>then html is :     "http:/localhost/images/logo.jsp"
>so I think "asales/pages/" is required.
>
>
>--- "Ruth, Brice" <br...@fiskars.com> wrote:
>  
>
>>If relative URIs work or don't work is dependent on
>>the HTML being 
>>produced, more than anything else, since its the
>>browser that then has 
>>to request the correct image from the server.
>>
>>What is the HTML being produced in the cases where
>>you don't see it working?
>>
>>javen fang wrote:
>>
>>    
>>
>>>Hi, all.  I am fajaven from
>>>      
>>>
>>matrix(www.matrix.org.cn)
>>    
>>
>>>in China.
>>>
>>>I wonder it seems like Struts cannot support
>>>      
>>>
>>relative
>>    
>>
>>>uri.
>>>
>>>In tomcat 5.0 , my webapp looks like:
>>>tomcat/webapps/asales
>>>
>>>Two files are:
>>>tomcat/webapps/asales/pages/left.jsp
>>>tomcat/webapps/asales/pages/images/logo.jpg
>>>
>>>Normally, in left.jsp, I use logo.jpg, like this:
>>><img src="images/logo.jpg"/>
>>>
>>>but if in left.jsp include struts tags, or it
>>>      
>>>
>>mapping
>>>from struts action, then relative uri will fail,
>>and
>>    
>>
>>>"absolute" uri is required:
>>><img src="/asales/pages/images/logo.jpg"/>
>>>
>>>You know, relative uri cannot be used is not
>>>convinient very much.
>>>
>>>How can I solve this question? 
>>>
>>>Thanks.
>>>
>>>javen fang from matrix
>>>
>>>__________________________________________________
>>>Do You Yahoo!?
>>>Tired of spam?  Yahoo! Mail has the best spam
>>>      
>>>
>>protection around 
>>    
>>
>>>http://mail.yahoo.com 
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>    
>>
>>>To unsubscribe, e-mail:
>>>      
>>>
>>struts-user-unsubscribe@jakarta.apache.org
>>    
>>
>>>For additional commands, e-mail:
>>>      
>>>
>>struts-user-help@jakarta.apache.org
>>    
>>
>>> 
>>>
>>>      
>>>
>>-- 
>>Brice D. Ruth
>>Sr. IT Analyst
>>Fiskars Brands, Inc.
>>
>>
>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>To unsubscribe, e-mail:
>>struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail:
>>struts-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts cannot support relative uri ?

Posted by Mahin Jeyachandran <ma...@hotmail.com>.
good day all,

I'm new to struts frame work...

I'm using a property file names "languages.properties" instead of =
"ApplicationResources.properties"
Also I have an entry in my "struts-config.xml" like the following...

<message-resources property=3D"language" />

I also placed the property file in "WEB-INF/classes/"
but it seems that the property file "languages.properties" is not =
detected.

shld I make any changes or any entry in the "web.xml" to make my new =
property file visible ????

I'm using web-logic6.1.

pls help..

Regards,
Mahin
AddVal Technology Inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts cannot support relative uri ?

Posted by Mark Lowe <ma...@talk21.com>.
Try this like George said

<head>

<html:base />

</head>

Cheers Mark

On Tuesday, October 28, 2003, at 03:55 PM, javen fang wrote:

>> but if in left.jsp include struts tags, or it mapping
>> from struts action, then relative uri will fail, and
>> "absolute" uri is required:
>> <img src="/asales/pages/images/logo.jpg"/>
>
> If in this condition, I do like this:
> <img src="images/logo.jsp"/>
>
> then html is :     "http:/localhost/images/logo.jsp"
> so I think "asales/pages/" is required.
>
>
> --- "Ruth, Brice" <br...@fiskars.com> wrote:
>> If relative URIs work or don't work is dependent on
>> the HTML being
>> produced, more than anything else, since its the
>> browser that then has
>> to request the correct image from the server.
>>
>> What is the HTML being produced in the cases where
>> you don't see it working?
>>
>> javen fang wrote:
>>
>>> Hi, all.  I am fajaven from
>> matrix(www.matrix.org.cn)
>>> in China.
>>>
>>> I wonder it seems like Struts cannot support
>> relative
>>> uri.
>>>
>>> In tomcat 5.0 , my webapp looks like:
>>> tomcat/webapps/asales
>>>
>>> Two files are:
>>> tomcat/webapps/asales/pages/left.jsp
>>> tomcat/webapps/asales/pages/images/logo.jpg
>>>
>>> Normally, in left.jsp, I use logo.jpg, like this:
>>> <img src="images/logo.jpg"/>
>>>
>>> but if in left.jsp include struts tags, or it
>> mapping
>>> from struts action, then relative uri will fail,
>> and
>>> "absolute" uri is required:
>>> <img src="/asales/pages/images/logo.jpg"/>
>>>
>>> You know, relative uri cannot be used is not
>>> convinient very much.
>>>
>>> How can I solve this question?
>>>
>>> Thanks.
>>>
>>> javen fang from matrix
>>>
>>> __________________________________________________
>>> Do You Yahoo!?
>>> Tired of spam?  Yahoo! Mail has the best spam
>> protection around
>>> http://mail.yahoo.com
>>>
>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>> struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>> struts-user-help@jakarta.apache.org
>>>
>>>
>>>
>>
>> -- 
>> Brice D. Ruth
>> Sr. IT Analyst
>> Fiskars Brands, Inc.
>>
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail:
>> struts-user-help@jakarta.apache.org
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts cannot support relative uri ?

Posted by javen fang <fa...@yahoo.com.cn>.
>but if in left.jsp include struts tags, or it mapping
>from struts action, then relative uri will fail, and
>"absolute" uri is required:
><img src="/asales/pages/images/logo.jpg"/>

If in this condition, I do like this:
<img src="images/logo.jsp"/>

then html is :     "http:/localhost/images/logo.jsp"
so I think "asales/pages/" is required.


--- "Ruth, Brice" <br...@fiskars.com> wrote:
> If relative URIs work or don't work is dependent on
> the HTML being 
> produced, more than anything else, since its the
> browser that then has 
> to request the correct image from the server.
> 
> What is the HTML being produced in the cases where
> you don't see it working?
> 
> javen fang wrote:
> 
> >Hi, all.  I am fajaven from
> matrix(www.matrix.org.cn)
> >in China.
> >
> >I wonder it seems like Struts cannot support
> relative
> >uri.
> >
> >In tomcat 5.0 , my webapp looks like:
> >tomcat/webapps/asales
> >
> >Two files are:
> >tomcat/webapps/asales/pages/left.jsp
> >tomcat/webapps/asales/pages/images/logo.jpg
> >
> >Normally, in left.jsp, I use logo.jpg, like this:
> ><img src="images/logo.jpg"/>
> >
> >but if in left.jsp include struts tags, or it
> mapping
> >from struts action, then relative uri will fail,
> and
> >"absolute" uri is required:
> ><img src="/asales/pages/images/logo.jpg"/>
> >
> >You know, relative uri cannot be used is not
> >convinient very much.
> >
> >How can I solve this question? 
> >
> >Thanks.
> >
> >javen fang from matrix
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> >http://mail.yahoo.com 
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> >
> >  
> >
> 
> -- 
> Brice D. Ruth
> Sr. IT Analyst
> Fiskars Brands, Inc.
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts cannot support relative uri ?

Posted by "Ruth, Brice" <br...@fiskars.com>.
If relative URIs work or don't work is dependent on the HTML being 
produced, more than anything else, since its the browser that then has 
to request the correct image from the server.

What is the HTML being produced in the cases where you don't see it working?

javen fang wrote:

>Hi, all.  I am fajaven from matrix(www.matrix.org.cn)
>in China.
>
>I wonder it seems like Struts cannot support relative
>uri.
>
>In tomcat 5.0 , my webapp looks like:
>tomcat/webapps/asales
>
>Two files are:
>tomcat/webapps/asales/pages/left.jsp
>tomcat/webapps/asales/pages/images/logo.jpg
>
>Normally, in left.jsp, I use logo.jpg, like this:
><img src="images/logo.jpg"/>
>
>but if in left.jsp include struts tags, or it mapping
>from struts action, then relative uri will fail, and
>"absolute" uri is required:
><img src="/asales/pages/images/logo.jpg"/>
>
>You know, relative uri cannot be used is not
>convinient very much.
>
>How can I solve this question? 
>
>Thanks.
>
>javen fang from matrix
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org