Struts2 and html:img

This might be very simple but i am stuck in the Struts2 for finding the alternative for Struts’ html:img tag.

src="images/navi/ball.gif" width="65" height="30" border="0"/>

In the above statement html:img tag prefix the context path and generate the statement like

 src="/conpath/images/navi/ball.gif" width="65" height="30" border="0"/>

The html tags are not the part of Struts2. I am looking ofr the equivalent tag for the same. As of now i am using

  src="<%=request.getContextPath()%>/images/navi/ball.gif" width="65" height="30" border="0"/>

Is there any other tag that can give me context path prefixed to the value
I tried

   src="<s:url value='/images/navi/ball.gif'/>" width="65" height="30" border="0"/>

Still this is not working. :mad:

My mistake, the solution lies in the first post itself.

<img   src="<s:url value='/images/navi/ball.gif'/>" width="65" height="30" border="0"/>

does solve the problem
Actually i was fetching the image name from one of the messages file. that was actually confusing me. finally i got the solution

<img   src="<s:url value="/" includeParams="none" /><s:text name="image.gif.spacer" />" width="65" height="30" border="0"/>


Eh sounds too complicated, I’ll prolly cook up JSP tag lib and be done w/ it.

yeh that is bit complex moreover there is a problem.
if your URL contains ;sessionid=…
then this method fails.
I am searching for a better solution but still not able to find it.

any help???

Your comment is confusing…

What breaks?


Do you need the jsessionid text or do not need the jsessionid text? Does it break if you use the jsessionid text or if you don’t use the jsessionid text?