Hi there,
I am using struts and hibernate 3.0, in JSP, I'd like to get the photo property and add prefix abd suffix, the display the picture. What way can I do that?
i.e. In the table customer, the field photo stores the picture name without extension, for instance, it is 20060108001 in field photo. I need add /pics/ as prefix and .jpg as suffix, so it becomes /pics/20060108001.jpg, and then display it.
Thanks,
Fei
Code:
<table border="1">
<tbody>
<logic:present name="customerListForm" property="customer">
<tr>
<td><bean:message key="customerForm.customer_name.displayname" />:</td>
<td><bean:write name="customer" property="customer_name"/></td>
</tr>
<tr>
<td><bean:message key="customerForm.photo.displayname" />:
</td>
<td><bean:write name="customer" property="photo" /></td>
</tr>
</logic:present>
<%-- if customers cannot be found display a text --%>
<logic:notPresent name="customerListForm" property="customer">
<tr>
<td colspan="5">No customer found.</td>
</tr>
</logic:notPresent>
</tbody>
</table>