Struts2 URL Tag
Posted by Martin Homik | Posted in Java, WebApp | Posted on 26-08-2008
0
I use the Struts2 URL tag all the time to expand relative paths with the current context. I also use it to address images. I have not proven it, but today, I got the hint that an image to which an argument is appended, will be loaded each time the page is displayed. To prevent appending of additional parameters, use the includeParams attribute and set the value to none. Below is an example for a dynamically created URL.
-
<s:url value="%{‘images/flags/’+locale+’.png’}" includeParams="none" id="localeURL"></s:url>

