Diferencia entre revisiones de «Portlet Con JSF»
De Dos Ideas.
(Página nueva: Para la configuración de jsf usaremos el bridge [jsf-portlet]) |
|||
| Línea 1: | Línea 1: | ||
| − | Para la configuración | + | Para la configuración del portlet con jsf usaremos el bridge [https://jsfportletbridge.dev.java.net/ jsf-portlet]. |
| + | |||
| + | El único archivo que vamos modificar es el portlet.xml, tenemos que especificar que use como portlet class una clase del bridge y setear atributos de incializacion para indicar que paginas de son las de view, edit y help. | ||
| + | |||
| + | <code xml> | ||
| + | <?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> | ||
| + | <!-- Clase del bridge para el funcionamiento de jsf--> | ||
| + | <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class> | ||
| + | |||
| + | <!-- seteo la pagina view --> | ||
| + | <init-param> | ||
| + | <description>Portlet init page</description> | ||
| + | <name>com.sun.faces.portlet.INIT_VIEW</name> | ||
| + | <value>/WEB-INF/jsp/blah.jsp</value> | ||
| + | </init-param> | ||
| + | <!-- seteo la pagina edit--> | ||
| + | <init-param> | ||
| + | <description>Portlet edit page</description> | ||
| + | <name>com.sun.faces.portlet.INIT_EDIT</name> | ||
| + | <value>/WEB-INF/jsp/edit.jsp</value> | ||
| + | </init-param> | ||
| + | <!-- seteo la pagina help--> | ||
| + | <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> | ||
| + | |||
| + | </code> | ||
Revisión del 16:52 13 mar 2009
Para la configuración del portlet con jsf usaremos el bridge jsf-portlet.
El único archivo que vamos modificar es el portlet.xml, tenemos que especificar que use como portlet class una clase del bridge y setear atributos de incializacion para indicar que paginas de 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>