0 Replies Latest reply on Sep 18, 2007 8:05 AM by philippe gouret

    Tomahawk with Portlet

    philippe gouret Newbie

      Hi

      i try to use Tomahawk 1.1.3 with JBoss Portal 2.6 (AS 4.2.1), like explained in :
      http://wiki.jboss.org/wiki/Wiki.jsp?page=JSFInPortletEnvironment
      , i use Tomahawk bridge 0.91.

      (Is it really possible to use these tools together ?)

      Deployment and initialization work, and components seems to work too, but the "submit" button on my form has no effect, except reseting all the form state. (input values are replaced by initial values)
      Note that i got a text: ~com.sun.faces.portlet.saveStateFieldMarker~ at the bottom of my form.

      It seems that JSF lifecycle is disturbed and that theres is a problem with state saving.

      Can you help me ?

      thanks

      Here are my setup files:

      web.xml:
      -----------

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>

      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
      </servlet-mapping>


      <!-- tomahawk bridge imposes it -->
      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>server</param-value>
      </context-param>

      <!-- MyFaces Tomahawk uses this filter to access resources like javascript script of images or CSS, ...-->
      <context-param>

      A very common problem in configuring MyFaces-web-applications
      is that the Extensions-Filter is not configured at all
      or improperly configured. This parameter will check for a properly
      configured Extensions-Filter if it is needed by the web-app.
      In most cases this check will work just fine, there might be cases
      where an internal forward will bypass the Extensions-Filter and the check
      will not work. If this is the case, you can disable the check by setting
      this parameter to false.

      <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
      <param-value>false</param-value>
      </context-param>

      <filter-name>extensionsFilter</filter-name>
      <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
      <init-param>
      Set the size limit for uploaded files.
      Format: 10 - 10 bytes
      10k - 10 KB
      10m - 10 MB
      1g - 1 GB
      <param-name>uploadMaxFileSize</param-name>
      <param-value>100m</param-value>
      </init-param>
      <init-param>
      Set the threshold size - files
      below this limit are stored in memory, files above
      this limit are stored on disk.

      Format: 10 - 10 bytes
      10k - 10 KB
      10m - 10 MB
      1g - 1 GB
      <param-name>uploadThresholdSize</param-name>
      <param-value>100k</param-value>
      </init-param>


      <!-- extension mapping for adding , , and other resource tags to JSF-pages -->
      <filter-mapping>
      <filter-name>extensionsFilter</filter-name>
      <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
      <servlet-name>Faces Servlet</servlet-name>
      </filter-mapping>

      <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
      <filter-mapping>
      <filter-name>extensionsFilter</filter-name>
      <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
      </filter-mapping>

      <filter-mapping>
      <filter-name>extensionsFilter</filter-name>
      <url-pattern>*.jsp</url-pattern>
      </filter-mapping>
      <filter-mapping>
      <filter-name>extensionsFilter</filter-name>
      <url-pattern>/faces/*</url-pattern>
      </filter-mapping>
      </web-app>

      portlet.xml:
      ---------------

      <?xml version="1.0" encoding="UTF-8"?>
      <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
      http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
      version="1.0">

      <!-- use JSF-portlet bridge (sun) -->



      <!--

      <portlet-name>TestPortlet</portlet-name>
      <portlet-class>org.apache.portals.bridges.portletfilter.FilterPortlet</portlet-class>

      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>

      <portlet-info>
      tree test
      </portlet-info>

      <init-param>
      Portlet init view page
      com.sun.faces.portlet.INIT_VIEW
      /WEB-INF/jsp/test.jsp
      </init-param>
      <init-param>
      portlet-class
      com.sun.faces.portlet.FacesPortlet
      </init-param>
      <init-param>
      portlet-filters

      jp.sf.pal.facesresponse.FacesResponseFilter,jp.sf.pal.tomahawk.filter.ExtensionsPortletFilter

      </init-param>


      </portlet-app>