File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes bean:write Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean:write" Watch "bean:write" New topic
Author

bean:write

Vijay Chandran
Ranch Hand

Joined: Jan 07, 2007
Posts: 178
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

Joined: Feb 08, 2006
Posts: 948
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

Joined: Aug 25, 2009
Posts: 63
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
 
GeeCON Prague 2014
 
subject: bean:write