Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Using Message Bundle In JSF Page

  • Edit tasklist-iteration3-start/tool/src/bundle/org/sakaiproject/tool/tasklist/bundle/Messages.properties
    • Using key value pairs
    • task_list_title=Task List
      task_list_add=Add Task
      task_list_date=Date Created
      task_list_text=Task
      task_list_id=ID
      task_list_delete=Delete
      task_list_owner=Owner
      
  • Modify "tool/src/webapp/tasklist/TaskList.jsp" to take advantage of message bundle
    <%@ taglib uri="http://sakaiproject.org/jsf/sakai" prefix="sakai" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> 
     <f:loadBundle basename="org.sakaiproject.tool.tasklist.bundle.Messages" var="msgs"/>
     
    <f:view>
    	<sakai:view_container title="Task List Tool">
    		<sakai:view_content>
    			<h:form id="tasks">
    			 	<sakai:view_title value="#{msgs.task_list_title}"/>
    			 	<h:outputText value="Hello, #{TaskListBean.currentUserDisplayName}"/>
    			 </h:form>
      		</sakai:view_content>	
    	</sakai:view_container>
    </f:view>
    
  • No labels