-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to manipulate formbean properties in JSP?
PostPosted: Mon Feb 06, 2006 1:54 am 
Newbie

Joined: Tue Oct 25, 2005 10:49 pm
Posts: 9
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.