You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by e-denton Java Programmer <ja...@e-denton.com> on 2004/10/26 19:47:47 UTC

Struts img tag usage

Hi!

I have been using the Struts img tag instead of the HTML img tag just cause
I was trying to use and learn the Struts tags, e.g. <html:img
page="/grafx/logo.jpg" width="150" height="140" alt="" />. But, now that I
have tried deploying, I find it doesn't work for me. Apparently, it adds the
jessionid onto the url
(http://www.xxx.com/grafx/logo.jpg;jsessionid=49A25B81DEBD4EF7281DA6FA542BE7
96) which somehow interferes with fetching the image. (It works on the first
load, but on subsequent ones, the cached copy fails.) I have read about the
tag online and in books, but the descriptions were terse with no examples.
So, I find I do not know the purpose or usage of the img (and, I suppose,
similar tags like link) tag.

1. Why does the url with the appended jsessionid fail?
2. When would you want the jsessionid appended?
2. How and when should one use Struts img? Examples please.

Thanks!


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


Re: Struts img tag usage

Posted by Mark Lowe <ma...@boxstuff.it>.
URLrewrite has similar functionality to mod_write if you're in a pure  
java environment or deploy to some grot like IIS.

http://tuckey.org/urlrewrite

Mark

On 26 Oct 2004, at 19:55, Matt Bathje wrote:

> e-denton Java Programmer wrote:
>> Hi!
>> I have been using the Struts img tag instead of the HTML img tag just  
>> cause
>> I was trying to use and learn the Struts tags, e.g. <html:img
>> page="/grafx/logo.jpg" width="150" height="140" alt="" />. But, now  
>> that I
>> have tried deploying, I find it doesn't work for me. Apparently, it  
>> adds the
>> jessionid onto the url
>> (http://www.xxx.com/grafx/logo.jpg; 
>> jsessionid=49A25B81DEBD4EF7281DA6FA542BE7
>> 96) which somehow interferes with fetching the image. (It works on  
>> the first
>> load, but on subsequent ones, the cached copy fails.) I have read  
>> about the
>> tag online and in books, but the descriptions were terse with no  
>> examples.
>> So, I find I do not know the purpose or usage of the img (and, I  
>> suppose,
>> similar tags like link) tag.
>> 1. Why does the url with the appended jsessionid fail?
>> 2. When would you want the jsessionid appended?
>> 2. How and when should one use Struts img? Examples please.
>> Thanks!
>
> Are you deploying to a server that has httpd in front of Tomcat (using  
> mod_jk or jk2 I would imagine)?
>
> I had this problem on my sites after deployment, and it was because of  
> the apache/tomcat link. I had to upgrade to mod_jk2, then add the  
> following to my host setup in httpd.conf:
> <Location "/images/*;jsessionid=*">
>   JkUriSet worker ajp13:localhost:8009
> </Location>
>
> The upgrade to mod_jk2 was necessary because mod_jk wasn't able to do  
> more than one wildcard match
>
> The problem never surfaced on my dev machine, because it uses  
> standalone tomcat. The test/live sites use httpd->jk2->tomcat.
>
>
>
> Matt
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


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


Re: Struts img tag usage

Posted by Matt Bathje <mp...@ntsource.com>.
e-denton Java Programmer wrote:
> Hi!
> 
> I have been using the Struts img tag instead of the HTML img tag just cause
> I was trying to use and learn the Struts tags, e.g. <html:img
> page="/grafx/logo.jpg" width="150" height="140" alt="" />. But, now that I
> have tried deploying, I find it doesn't work for me. Apparently, it adds the
> jessionid onto the url
> (http://www.xxx.com/grafx/logo.jpg;jsessionid=49A25B81DEBD4EF7281DA6FA542BE7
> 96) which somehow interferes with fetching the image. (It works on the first
> load, but on subsequent ones, the cached copy fails.) I have read about the
> tag online and in books, but the descriptions were terse with no examples.
> So, I find I do not know the purpose or usage of the img (and, I suppose,
> similar tags like link) tag.
> 
> 1. Why does the url with the appended jsessionid fail?
> 2. When would you want the jsessionid appended?
> 2. How and when should one use Struts img? Examples please.
> 
> Thanks!
> 

Are you deploying to a server that has httpd in front of Tomcat (using 
mod_jk or jk2 I would imagine)?

I had this problem on my sites after deployment, and it was because of 
the apache/tomcat link. I had to upgrade to mod_jk2, then add the 
following to my host setup in httpd.conf:
<Location "/images/*;jsessionid=*">
   JkUriSet worker ajp13:localhost:8009
</Location>

The upgrade to mod_jk2 was necessary because mod_jk wasn't able to do 
more than one wildcard match

The problem never surfaced on my dev machine, because it uses standalone 
tomcat. The test/live sites use httpd->jk2->tomcat.



Matt



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