I use the tag IMG to display images on my site - It however looks like I am limited in what I attempt to do because this tag can only access images that are located within the application directory.

Ted Husted

The Struts JSP tags solve the problems of

  • accessing application resources without embedding the application context in your URI, and
  • accessing application resources that might require an authenticated user
In the former case, the tags insert the application context for you. (Along with the module context in Struts 1.1.) In the later case, the tags encode the URI so that the user's session is maintained.

If neither of these use cases apply, then don't use the Struts tags. =:0)

So the answer to your question is to use a plain old <img> tag. The Struts tags are not a value-add here; don't use them.

Sometimes, people do seem to get the idea that every tag on a page should be a Struts tag. But that is not how the tags are designed to be used, and no one on the Struts team would recommend such a practice.

-- Ted Husted, Struts in Action.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact