Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

I18N struts tag value

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
One more question on I18N to complete this project.
What is the syntax to internationalize/localize the value="xx" in all the strut tags? I have tried <html:text property="field0" value="${myMessagResourceBundle.field0.label}"/>, which doesnt work. I also tried eliminating it entirely and setting it in the formBean reset(), which also didnt work. Where am I wrong? tia.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One feature of Struts tags that's not very well documented is the fact that if you provide a body for the tag, it will be used in the place of a value attribute. So, in your example, the following should work:


I normally don't like to set values for fields in the JSP, though, because it doesn't work for validation. If the JSP is redisplayed due to a validation error, the value will show as the default value, not the value the user entered.
[ December 20, 2007: Message edited by: Merrill Higginson ]
 
Chris Pat
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Merrill Higginson:
One feature of Struts tags that's not very well documented is the fact that if you provide a body for the tag, it will be used in the place of a value attribute. So, in your example, the following should work:


I normally don't like to set values for fields in the JSP, though, because it doesn't work for validation. If the JSP is redisplayed due to a validation error, the value will show as the default value, not the value the user entered.

[ December 20, 2007: Message edited by: Merrill Higginson ]



Hi
Excellent edification, on both.
I defer to your experience with the validation. This is just for proof of concept. The difficulty was that I was trying to set the value of strut tags that are not input, i.e. button, submit, so if they are hardcoded for their localization that is actually fine on validation. It works great. Thank you.
 
We find this kind of rampant individuality very disturbing. But not this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic