Presentation is loading. Please wait.

Presentation is loading. Please wait.

JSF Portlet Message Bundles

Similar presentations


Presentation on theme: "JSF Portlet Message Bundles"— Presentation transcript:

1 JSF Portlet Message Bundles
Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission from Liferay, Inc.

2 Objective The goal of this tutorial is to : Create a message bundles
language.properties Modify UI Components to use the Message Bundle index.jsp

3 Language.properties Create …/ext/portlets/library_jsf_portlet.war/WEB_INF/classes/Language.properties: add_a_book_entry_to_the_library=Add a Book Entry to the Library add_book=Add Book book_title=Book Title display_books=Display Books simple_jsf_portlet=Simple JSF Portlet

4 index.jsp taglib uri=" prefix="f" %> taglib uri=" prefix="h" %> <f:view> <f:loadBundle basename="Language" var="msgs" /> <h1> <h:outputText value="#{msgs.simple_jsf_portlet}" /> </h1> <h3> <h:outputText value="#{msgs.add_a_book_entry_to_the_library}:" /> </h3>

5 <h:form> <h:messages infoClass="portlet-msg-success" errorClass="portlet-msg-error" /> <br/> <h:outputText value="#{msgs.book_title}:" /> <h:inputText id="bookTitle" value="#{book.title}" required="true"> <f:validateLength minimum="2" maximum="30" /> </h:inputText> <h:commandButton actionListener="#{book.addBook}" value="#{msgs.add_book}" /> <h:commandButton action="#{book.displayBooks}" value="#{msgs.display_books}" immediate="true" /> </h:form> </f:view>

6 Deploy the Files to Tomcat
Compile Deploy Refresh Verify

7 Final Steps Restart Tomcat
Open up a new browser and type LOGIN: PASSWORD: test

8 Revision History Jerry Niu 9/7/2006-9/11/2006
- Slide create and updates Scott Lee 10/30/2006 - updated slides to include permissions fields in service.xml Scott Lee 12/9/2006 - corrected code for success.jsp James Min 01/17/2007 - Convert for JSF


Download ppt "JSF Portlet Message Bundles"

Similar presentations


Ads by Google