1

After three years on a RESTful Java/ExtJS application, I have taken over development of a Java/JSP application.

New to Java Struts, I am finding the use of struts tags in JSP pages to be insanely verbose, e.g.

<input type="button" value='<bean:message key="button.addDoc"/>' />

Of course there are about 1700 message tags in every page, and it would seem that something like $m("button.addDoc") would be quite enough. Is there some way to shorten the bean:message elements to something less noisy, or is this just the Java way?

kevin cline
  • 2,608
  • 2
  • 25
  • 38
  • 1
    related: http://stackoverflow.com/questions/3174373/is-there-and-shorthand-for-fmtmessage-key-key – Bozho May 12 '11 at 15:58

1 Answers1

1

or is this just the Java way?

That's just the Struts way. It's a pretty legacy MVC framework. You could consider to look for a different MVC framework which resolves properties by just EL, for example JSF.

E.g.

<h:commandButton value="#{bundle.addDoc}" />

It's only going to be a lot of work with that much pages/tags. Since it's apparently an assignment, I'd just live with it and keep it for the future in mind to deny old Struts based projects.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555