25.02.2015 Views

Introducing Spring Framework

Introducing Spring Framework

Introducing Spring Framework

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 10 ■ Showing Your <strong>Spring</strong> Application on the Web<br />

Listing 10-10 shows the English message_en.properties file. Next, let’s look at Listing 10-11, which is the<br />

Spanish version.<br />

Listing 10-11. WEB-INF/i18n/message_es.properties<br />

main.title=Bienvenido a Mis Documentos<br />

search.subtitle=.:: Mis Documentos - Busqueda ::.<br />

search.name=Nombre:<br />

search.type=Tipo:<br />

search.location=Localidad:<br />

Listing 10-11 shows the Spanish message_es.properties file. As you can see, the only thing that changed in all<br />

these files is the value of every property. Now let’s run the application using gradle :ch10:jettyRun. If you add the<br />

parameter ?lang=es your page will be in Spanish! Figure 10-3 shows the results in Spanish and then Figure 10-4 shows<br />

it set back to English.<br />

Figure 10-3. http://localhost:8080/ch10/mydocuments/search/all?lang=es<br />

143

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!