aspose file tools*
The moose likes Struts and the fly likes Struts img tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts img tag?" Watch "Struts img tag?" New topic
Author

Struts img tag?

Jessica Doe
Ranch Hand

Joined: Dec 11, 2003
Posts: 32
Hi!

I had used the Struts 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 deployed, I find it doesn't work for me. Apparently, it adds the jessionid onto the url (http://www.xxx.com/grafx/logo.jpg;jsessionid=49A25B81DEBD4EF7281DA6FA542BE796) which somehow interferes with fetching the image. I read about the tag online and in a book, 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).

1. Why doesn't the url with the appended jsessionid work?
2. When would you want the jsessionid appended?
2. How and when do you use img?

Thanks!


Jessica Doe<br /> <br />C# Online.NET<br /> <a href="http://wiki.csharp-online.net/" target="_blank" rel="nofollow">http://wiki.csharp-online.net/</a>
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

Originally posted by Jessica Doe:

1. Why doesn't the url with the appended jsessionid work?
2. When would you want the jsessionid appended?
2. How and when do you use img?

1) I'm not sure of this one. Do links work? Maybe the server is getting confused about having a parameter with a simple image.
2) You would want the appended jsessionid if you are doing URL rewriting. This applies to cloned/clustered servers. URL rewriting is a way of having all of a single user's requests go to the same server. This can be useful for links, but not for images. An image is an images. It doesn't matter where it comes from.
3) I don't. It doesn't give me any value over the regular HTML tag. I suppose it could be used when your image is generated at runtime.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jessica Doe
Ranch Hand

Joined: Dec 11, 2003
Posts: 32
Ok, thanks for the reply.

Apparently, it's not a Struts problem. According to the Struts Mailing List, with a server that has httpd in front of Tomcat with mod_jk or jk2, one solution is to upgrade to mod_jk2 (because mod_jk can't handle more than one wildcard match) and to add something like the following to the host setup (httpd.conf):

<Location "/images/*;jsessionid=*">
JkUriSet worker ajp13:localhost:8009
</Location>

This problem cannot occur with standalone Tomcat--perhaps on a development system--but, can show up when the application is deployed to a server using httpd -> mod_jk -> Tomcat.

(URLrewrite has similar functionality to mod_write).

Haven't tried it yet.

Ciao!

[ October 27, 2004: Message edited by: Jessica Doe ]
[ October 27, 2004: Message edited by: Jessica Doe ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts img tag?