• Post Reply Bookmark Topic Watch Topic
  • New Topic

Default value in RT Exp formater

 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!