O'Reilly logo

Struts Kick Start by Kevin Bedell, James Turner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Internationalization

You’ve already seen how the error messages returned from a form validation can be internationalized. The same can be done with the contents of a JSP file.

The bean:message tag looks for a value in the specified message bundle (your friend ApplicationResources.properties by default) and sends it to the browser, and can even take up to five parameterized arguments. Listing 7.9 shows minibar.jsp rewritten to support international text.

Listing 7.9. minibar.jsp Rewritten
 <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="tmp"%> <%@ taglib uri="/WEB-INF/stock.tld" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required