getting path value from bean using struts2
public class product {
privat开发者_JAVA技巧e String name;
private String path;
// and getter setter of attributes
}
I want to get the path
value from the bean and give this path value in "img src" tag.
I know that print the path attribute value but my question is that use this path value in img tag to upload this image
Assuming ModelDriven
with a product
as the model:
<img src="<s:property value='path'/>"/>
<%-- You can also use JSP EL --%>
<img src="${path}"/>
If there's an action property instead, use normal bean notation:
<img src="<s:property value='product.path'/>"/>
<img src="${product.path}"/>
精彩评论