Web Hosting Java, JSP, Tomcat 6, J2EE, Servlets, Struts, Jboss
JavaSercer Pages 11.2 Generating Localized Output Now that (Php5 web hosting)
December 30, 2006 on 2:22 pm | In Java | JavaSercer Pages 11.2 Generating Localized Output Now that you have an understanding of the type of internationalization support Java provides, let’s look at a concrete example. But instead of using the internationalization classes directly in the pages, let’s use a set of custom actions based on these classes. Using custom actions minimizes the need for Java code in the JSP pages, making it easier for page authors to develop an internationalized site. The example application, briefly described in the introduction to this chapter, lets visitors voice their opinions by selecting one of the answers to a question, as well as seeing how others have answered. The text, numbers, and dates are available in three different languages. Figure 11.1 shows all pages used in this application and how they are related. Figure 11.1. Localized poll application pages The first page the user sees is the poll.jsp page, shown in Figure 11.2. The language used to display the contents the first time this page is displayed is based on the Accept-Language header value in the request. The top part of the page contains radio buttons for the three supported languages and a Submit button. If the user wants the application to be presented in another language, he or she selects the corresponding radio button and clicks Submit, causing the page to be requested again, this time with a language parameter included in the request. The value of the language parameter is then used to display the page in the selected language. Information about the selected language is saved as session data, so it’s available to all the other application pages. Figure 11.2. The language selection and question page page 152
Note: If you are looking for cheapest and affordable webspace to host and run your servlet application check Astra j2ee hosting services
No Comments yet
Sorry, the comment form is closed at this time.
...I
just wanted to take the time to say "Thank you!" for our new webmail
system. It's great! Thanks for taking such good care of us.
Thanks
for helping me out. Just for the record, Webhostingjava.net has been a great
web host! So far your support and handling of questions has far
exceeded that of a "larger web hosting company".
I
would like to thank you for helping me with my domain...You have
shown me great patience and professionalism. I would not hesitate to
recommend you to my clients.