Portlet Con JSF

De Dos Ideas.
Saltar a: navegación, buscar

Para que nuestro portlet funcione con jsf necesitamos modificar el archivo portlet.xml y debemos tener un bridge(*LINK*) que nos permita el funcionamiento de este en el portal.

Ejemplo

Para este ejemplo usaremos el bridge jsf-portlet.

En el portlet.xml debemos setear el portlet class con FacesPortlet (pertenece al bridge) y setear atributos de incializacion para indicar que paginas son las de view, edit y help.


<?xml version="1.0" encoding="UTF-8" ?> <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0">

   <portlet>
       <description>Demo de portlet con jsf y spring</description>
       <portlet-name>BlahJsfPortlet</portlet-name>
       <display-name>Blah JSF Portlet - Frases en secuencia</display-name>
       <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>   
       <init-param>
           <description>Portlet init page</description>
           <name>com.sun.faces.portlet.INIT_VIEW</name>
           <value>/WEB-INF/jsp/blah.jsp</value>
       </init-param>
       <init-param>
           <description>Portlet edit page</description>
           <name>com.sun.faces.portlet.INIT_EDIT</name>
           <value>/WEB-INF/jsp/edit.jsp</value>
       </init-param>
       <init-param>
           <description>Portlet Help page</description>
           <name>com.sun.faces.portlet.INIT_HELP</name>
           <value>/WEB-INF/jsp/help.jsp</value>
       </init-param>


       <supports>
           <mime-type>text/html</mime-type>
           <portlet-mode>VIEW</portlet-mode>
           <portlet-mode>EDIT</portlet-mode>
           <portlet-mode>HELP</portlet-mode>
       </supports>
       <resource-bundle>com.test.messages</resource-bundle>
       <portlet-info>
           <title>Blah jsf Portlet - Frases en secuencia</title>
           <short-title>Blah Jsf Portlet</short-title>
       </portlet-info>
   </portlet>

</portlet-app>


Ejemplo de portlet con jsf y spring.


Ver también