Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bean:write

 
Vijay Chandran
Ranch Hand
Posts: 186
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,

I am using <bean:write> tag for displaying data in a JSP.


Is there any way to get a substring of the value i get in the property attribute of the <bean : write>

Kindly provide your help.
Regards,
vijay
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not know of a way to get a substring. I am not sure exactly what you are trying to do but in general if I find myself having to implement logic that is more than nontrivial in my JSP, I try to move that into a method in my form. For example, if I had an SSN and I wanted to mask all but the last 4 digits I would add a method to my form named getMaskedSSN(), move the logic there and then use the property maskedSSN in my JSP.

- Brent
 
RamandeepS Singh
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was facing same problem

and find out solution something like this...

<bean:define id="text" scope="request">
<bean:write name="smsBean" property="strSmsText" />
</bean:define>

<%=text.substring(0,50);%>

hope this helps
Ramandeep
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic