O'Reilly logo

Spring MVC Beginner’s Guide by Amuthan G

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

Externalizing text messages

So far, in all our view files, we hardcoded text values for all of the labels. For instance, take our addProduct.jsp file for the product ID input tag; we have a label tag with a hardcoded text value as ProductId, as follows:

<label class="control-label col-lg-2 col-lg-2" for="productId">Product Id</label>

Externalizing these texts from a view file into a properties file will help us have single, centralized control of all the label messages, and moreover, it will help us make our web pages ready for internationalization. We will see more about internationalization in Chapter 6, Intercept Your Store with Interceptor, but in order to do internationalization, we need to externalize the label messages first. So now, we are ...

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