This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Default value in RT Exp formater Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Default value in RT Exp formater" Watch "Default value in RT Exp formater" New topic
Author

Default value in RT Exp formater

Ove Lindström
Ranch Hand

Joined: Mar 10, 2008
Posts: 326

Hi,

I am currently cleaning up some messy JSP-code, introducing JSTL and Struts taglibs.

We have a lot of code that looks like this:

where we get at text from a bean or request attribute and output it on the screen but use a default value if the provided attibute is null.

Our current string formater looks like this:


Is there a way to use the format or formatKey-part of <bean:write>-tag to output a default value if null?

I've created formatKeys for the decimal, data and other formated data, but I can't get the normal String-format to work.
 
Have you checked out Aspose?
 
subject: Default value in RT Exp formater
 
It's not a secret anymore!