Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

html:img tag does not work when ActionErrors brings you back

Status
Not open for further replies.

markricard

IS-IT--Management
Jun 5, 2005
2
US
In my jsp page I have the following code in a page called "listing.jsp":

<html:img height="48" width="48" alt="" src="../images/newListing.gif"/>

When the page first comes up, I can see the graphic perfectly. After the user presses submit and there are errors that I find in the ActionForm validate() method, when struts comes back to my original listing.jsp page (now listing.do) all of the images are no longer found - just an empty space where it should be. When I inspect the html code itself, the location looks fine - "../images/newListing.gif" is there.

Anyone?
 
In fooling around with it I discovered you should never use ".." in the src attribute of the html:img. While it worked initially, it quit working once inside the struts handlers.

Also, I changed the src to page. Here is the form in which it works now:

<html:img height="48" width="48" alt="" page="/images/newListing.gif"/>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top