File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

display string

 
prashant kond
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Our requirement to show only limited characters of the length of the string in UI page. I am using bean:write tag but which is displaying entire string. But I have to show only limited characters then suffixed that string with the dots.
If any one having idea on this would be appriciate.
 
Ud Naik
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the string only for display or do you need the value later for processing?

One way could be to extend the reset() method of the ActionForm, change the value of that string; in your case, truncate the string to whatever length you want and append dots to it.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd suggest creating a second getter for the field. Example:


Then in your JSP, you code <bean:write name="myForm" property="truncatedString" />
 
prashant kond
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the solution which you posted. It is working properly with the getter method.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic