aspose file tools
The moose likes Struts and the fly likes bean:write Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "bean:write" Watch "bean:write" New topic
Author

bean:write

Vijay Chandran
Ranch Hand

Joined: Jan 07, 2007
Posts: 175
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: 59
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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: bean:write
 
Similar Threads
TagLib parameter problem
why+beans+are+used?
Tag to display and fill Form
Passing the value of bean:write tag as a prameter. Is it possible?
logic: equal question