incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Wessendorf" <mat...@apache.org>
Subject Re: [Trinidad] using t:saveState
Date Wed, 20 Dec 2006 13:00:03 GMT
here is another web.xml;
using tomahawk and trinidad in one project

<?xml version = '1.0' encoding = 'ISO-8859-1'?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">

  <context-param>
<param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
    <param-value>com.sun.facelets.FaceletViewHandler</param-value>
  </context-param>

  <!-- Use Documents Saved as *.xhtml -->
  <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
  </context-param>

   <context-param>
   <param-name>facelets.LIBRARIES</param-name>
   <param-value>/WEB-INF/tomahawk.taglib.xml</param-value>
    </context-param>

  <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
  </context-param>

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

  <context-param>
    <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
    <param-value>session</param-value>
  </context-param>

  <filter>
    <filter-name>trinidad</filter-name>
    <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
  </filter>

  <filter>
	  <filter-name>MyFacesExtensionsFilter</filter-name>
	  <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
      <init-param>
        <param-name>maxFileSize</param-name>
        <param-value>20m</param-value>
      </init-param>
  </filter>

  <filter-mapping>
    <filter-name>trinidad</filter-name>
    <servlet-name>faces</servlet-name>
  </filter-mapping>


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

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

  <!-- Listener, to allow Jetty serving MyFaces apps -->
  <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
  </listener>

  <!-- Faces Servlet -->
  <servlet>
    <servlet-name>faces</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
  </servlet>

  <!-- resource loader servlet -->
  <servlet>
    <servlet-name>resources</servlet-name>
    <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
  </servlet>

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

  <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/adf/*</url-pattern>
  </servlet-mapping>

</web-app>



On 12/20/06, Matthias Wessendorf <matzew@apache.org> wrote:
> Renzo,
>
> can you please reduce your font size ? :)
> Hard to read in gmail :)
>
> Regarding the verifyFilterIsInstalled method...
> perhaps the TrinidadFilter is not *ordered* in the "right" way?
> I have them listed in web.xml before the servlets (and their mapping)
>
> Perhaps you wonder why the TrinidadFilterImpl present. That is because
> it is added via the Meta-inf/service facility.
>
> Here is a web.xml of one of my projects, using Shale, Trinidad,
> facelets and myfaces
>
> <?xml version = '1.0' encoding = 'ISO-8859-1'?>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>          version="2.4">
>
>   <context-param>
>     <param-name>org.apache.myfaces.trinidadinternal.DISABLE_CONTENT_COMPRESSION</param-name>
>     <param-value>false</param-value>
>  </context-param>
>
>   <context-param>
>     <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
>     <param-value>com.sun.facelets.FaceletViewHandler</param-value>
>   </context-param>
>
>   <!-- Use Documents Saved as *.xhtml -->
>   <context-param>
>     <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
>     <param-value>.xhtml</param-value>
>   </context-param>
>
>
>   <context-param>
>     <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
>     <param-value>client</param-value>
>   </context-param>
>
>   <context-param>
>     <param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
>     <param-value>false</param-value>
>   </context-param>
>
>   <context-param>
>     <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
>     <param-value>true</param-value>
>   </context-param>
>
>   <context-param>
>     <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
>     <param-value>session</param-value>
>   </context-param>
>
>   <!-- Commons Chain Configuration Resources -->
>   <context-param>
>     <param-name>org.apache.commons.chain.CONFIG_WEB_RESOURCE</param-name>
>     <param-value>/WEB-INF/chain-config.xml</param-value>
>   </context-param>
>
>     <!-- Shale Application Controller Filter -->
>   <filter>
>     <filter-name>shale</filter-name>
>     <filter-class>
>       org.apache.shale.application.faces.ShaleApplicationFilter
>     </filter-class>
>   </filter>
>
>   <filter>
>     <filter-name>trinidad</filter-name>
>     <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
>   </filter>
>
>   <!-- Shale Application Controller Filter Mapping -->
>   <filter-mapping>
>     <filter-name>shale</filter-name>
>     <url-pattern>/*</url-pattern>
>   </filter-mapping>
>
>   <filter-mapping>
>     <filter-name>trinidad</filter-name>
>     <servlet-name>faces</servlet-name>
>   </filter-mapping>
>
>   <!-- Listener, to allow Jetty serving MyFaces apps -->
>   <!--listener>
>     <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
>   </listener-->
>
>   <!-- Commons Chain Configuration Listener -->
>   <listener>
>     <listener-class>
>       org.apache.commons.chain.web.ChainListener
>     </listener-class>
>   </listener>
>
>
>   <!-- Faces Servlet -->
>   <servlet>
>     <servlet-name>faces</servlet-name>
>     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>   </servlet>
>
>   <!-- resource loader servlet -->
>   <servlet>
>     <servlet-name>resources</servlet-name>
>     <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
>   </servlet>
>
>   <!-- Faces Servlet Mappings -->
>   <servlet-mapping>
>     <servlet-name>faces</servlet-name>
>     <url-pattern>*.faces</url-pattern>
>   </servlet-mapping>
>
>   <servlet-mapping>
>     <servlet-name>resources</servlet-name>
>     <url-pattern>/adf/*</url-pattern>
>   </servlet-mapping>
>
> </web-app>
>
> -Matthias
>
> On 12/20/06, Renzo Tomaselli <renzo.tomaselli@tecnotp.it> wrote:
> >
> >  Hi, back again to adapt an application to Trinidad.
> >  I have a page using Tomahawk t:saveState to save a string across requests.
> > This page contains also a t:tree2 component. Now if I perform any action on
> > the tree - such as clicking on nodes or expanding branches - my debugger
> > shows that state is not restored. Other setters are regularly invoked.
> >  But if I use the back button on the browser and I click again on the tree,
> > state is restored. It works like a flip-flop, once out of two.
> >  I don't know the magics of state saving with Trinidad, I guess things
> > depend on a hidden element attached to forms, such as:
> >
> >  <input type="hidden"
> > name="org.apache.myfaces.trinidad.faces.STATE"
> > value="!23efc8f3">
> >
> >  Also I noticed that sources of rendered html page are the same, both when
> > next click will work and when it will not.
> >  Needless to say, things used to work fine until Trinindad entered my
> > web.xml.
> >  Also I noticed that Tomcat logout still reports:
> >
> >  20-dic-2006 12.42.53
> > org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl
> > verifyFilterIsInstalled
> >  WARNING: The TrinidadFilter has not been installed.  Apache Trinidad
> > requires this filter for proper execution.
> >
> >  but my web.xml contains:
> >
> >    <filter>
> >      <filter-name>trinidad</filter-name>
> >
> > <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
> >    </filter>
> >
> >    <filter-mapping>
> >      <filter-name>trinidad</filter-name>
> >      <servlet-name>faces</servlet-name>
> >    </filter-mapping>
> >
> >  Any suggestion is welcome. I can ispect/debug sources if provided with some
> > pointers about state restoring.
> >  -- Renzo
> >
> >
>
>
> --
> Matthias Wessendorf
> http://tinyurl.com/fmywh
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Mime
View raw message