incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romanowski, Tim" <tim.romanow...@lmco.com>
Subject RE: [trinidad] configuration: web.xml ordering
Date Wed, 20 Dec 2006 18:47:36 GMT
I'm not sure whether this is related, but I'm getting an intermittent
error in my logs that the Trinidad Filter is not installed:

 

"The TrinidadFilter has not been installed.  Apache Trinidad requires
this filter for proper execution."

 

However, I don't get this the first time I start my server (Glassfish v2
b23) and deploy my app, only on successive accesses to the page does it
occur.  I've played around with the ordering of my filters, and haven't
found a resolution.  It seems like everyone has slightly different
web.xml setups, even when using the same combination of filters.  In my
case, I'm using Ajax4JSF, Tomahawk, Trinidad, Facelets and JSF RI 1.2.
Does anyone have a suggestion on where my configuration is hosed?
Something is definitely wrong, as I am having problems displaying both
standard h:commandButton tags as well as tr:commandButton tags-images
aren't rendered, and even the trinidad styling doesn't appear to be
applied.  This is the output of one of the buttons:

 

<button id="j_id83:j_id90" name="j_id83:j_id90" type="button"
onclick="submitForm('j_id83',1,{source:'j_id83:j_id90'});return false;"
class="x6j"></button>

 

Is class "x6j" a trinidad style?  The button is squashed, looking like a
hyphen on the screen.

 

This is in my faces-config.xml:

  <application>

             

    <locale-config>

      <default-locale>en</default-locale>

      <supported-locale>es_pr</supported-locale>

    </locale-config>

 

  <!-- Use the Trinidad RenderKit - this is needed with Ajax4JSF as
well. -->

  <default-render-kit-id>

    org.apache.myfaces.trinidad.core

  </default-render-kit-id>

  

  <!-- The facelets viewhandler must not be added here when using
ajax4jsf! -->

    <!-- <view-handler>

            com.sun.facelets.FaceletViewHandler

        </view-handler> -->

  </application>

 

 

This is in my web.xml:  

 

<?xml version="1.0" encoding="UTF-8"?>

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

   

    <!-- This version of web.xml contains Trinidad support. -->

   

    <context-param>

 
<param-name>org.apache.myfaces.trinidad.resource.DEBUG</param-name>

        <param-value>true</param-value>

    </context-param>

    

    <context-param>

 
<param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-na
me>

        <param-value>com.sun.facelets.FaceletViewHandler</param-value>

    </context-param> 

    

   <!--  Do not set this parameter when using Trinidad.

    <context-param>

        <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>

        <param-value>com.sun.facelets.FaceletViewHandler</param-value>

    </context-param>  -->

    

    <!-- Use prefix-mapping instead of suffix-mapping.

         This allows us to support both *.xhtml and *.jsp files -->

    <context-param>

        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

        <param-value>/faces/*</param-value>

    </context-param>

    

    <!-- Special Debug Output for Development -->

    <context-param>

        <param-name>facelets.DEVELOPMENT</param-name>

        <param-value>true</param-value>

    </context-param>

    

    <!-- Tell Facelets whether or not to skip comments before compiling
-->

    <context-param>

        <param-name>facelets.SKIP_COMMENTS</param-name>

        <param-value>true</param-value>

    </context-param>

   

    <!-- The buffer size to set on the response when the ResponseWriter
is generated. 

       By default the value is -1, which will not assign a buffer size
on the response.  -->

    <context-param>

        <param-name>facelets.BUFFER_SIZE</param-name>

        <param-value>8192</param-value>

    </context-param>  

    

    <!-- For using Tomahawk and FacesTrace components with Facelets -->

    <context-param>

        <param-name>facelets.LIBRARIES</param-name>

        <param-value>

 
/WEB-INF/facestrace.taglib.xml;/WEB-INF/tomahawk.taglib.xml;/WEB-INF/tig
er.taglib.xml

        </param-value>

    </context-param>

   

    <context-param>

        <param-name>com.sun.faces.verifyObjects</param-name>

        <param-value>true</param-value>

    </context-param>

    

    <context-param>

        <param-name>com.sun.faces.validateXml</param-name>

        <param-value>true</param-value>

    </context-param>

    

    <!-- Do not use with Trinidad.

    <context-param>

        <param-name>org.ajax4jsf.SKIN</param-name>

        <param-value>DEFAULT</param-value>

    </context-param>    

    -->

    

    <!-- Don't need the code below, because the path is parsed
automatically, per the JSF spec.

    <context-param>

        <param-name>javax.faces.CONFIG_FILES</param-name>

        <param-value>/WEB-INF/faces-config.xml</param-value>

    </context-param> -->    

    

    <!-- <context-param>  For MyFaces/Tomahawk ... unfortunately doesn't
currently work with Trinidad.

    <description>If true, a javascript function will be rendered that is
able to restore the

            former vertical scroll on every request. Convenient feature
if you have pages

            with long lists and you do not want the browser page to
always jump to the top

            if you trigger a link or button action that stays on the
same page.

            Default: "false"</description>

    <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>

    <param-value>true</param-value>

  </context-param> -->

  

    <context-param>

        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

        <param-value>server</param-value>

    </context-param>

    

    <filter>

        <filter-name>trinidad</filter-name>

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

    </filter>

    

    <filter>

        <display-name>Ajax4jsf Filter</display-name>

        <filter-name>ajax4jsf</filter-name>

        <filter-class>org.ajax4jsf.Filter</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>ajax4jsf</filter-name>

        <!--  <url-pattern>*.faces</url-pattern> -->

        <servlet-name>Faces Servlet</servlet-name>

        <dispatcher>REQUEST</dispatcher>

        <dispatcher>FORWARD</dispatcher>

        <dispatcher>INCLUDE</dispatcher>

    </filter-mapping> 

    

    <filter-mapping>

        <filter-name>trinidad</filter-name>

        <servlet-name>Faces Servlet</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</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>

    

    <!-- Begin add for Tomahawk Extensions Filter -->

    <filter-mapping>

        <filter-name>MyFacesExtensionsFilter</filter-name>

        <url-pattern>*.faces</url-pattern>

    </filter-mapping>   

    

    <filter-mapping>

        <filter-name>MyFacesExtensionsFilter</filter-name>

        <url-pattern>*.jsf</url-pattern>

    </filter-mapping>   

    

    <filter-mapping>

        <filter-name>MyFacesExtensionsFilter</filter-name>

        <url-pattern>*.jsp</url-pattern>

    </filter-mapping>

    

    <filter-mapping>

        <filter-name>MyFacesExtensionsFilter</filter-name>

        <url-pattern>/faces/*</url-pattern>

    </filter-mapping>     

    <!-End add for extensions filter. -->

 

    

    <servlet>

        <servlet-name>resources</servlet-name>

 
<servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servl
et-class>

    </servlet> 

    

    <servlet>

        <servlet-name>Faces Servlet</servlet-name>

        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

        <load-on-startup>1</load-on-startup>

    </servlet>

 

    

    <servlet-mapping>

        <servlet-name>Faces Servlet</servlet-name>

        <url-pattern>/faces/*</url-pattern>

    </servlet-mapping>

   

    <servlet-mapping>

        <servlet-name>Faces Servlet</servlet-name>

        <url-pattern>*.faces</url-pattern>

    </servlet-mapping>

 

    <servlet-mapping>

        <servlet-name>resources</servlet-name>

        <url-pattern>/faces/*</url-pattern>

    </servlet-mapping>

 

    <session-config>

        <session-timeout>

            30

        </session-timeout>

    </session-config>

    <welcome-file-list>

        <welcome-file>

            index.jsp

        </welcome-file>

    </welcome-file-list>

 

</web-app>

 

________________________________

From: Renzo Tomaselli [mailto:renzo.tomaselli@tecnotp.it] 
Sent: Wednesday, December 20, 2006 4:40 AM
To: adffaces-user@incubator.apache.org
Subject: Re: [trinidad] configuration: web.xml ordering

 

Matthias, your web.xml is quite similar to mine (actual working case).
What I did first - was simply to cut & paste from the wiki page all
Trinidad stuff, appending it to the end of web.xml.
This appeared to be a logical choice. It didn't work.
Then from an old post  I discovered that I had to comment out the
<view-handler> line from faces-config.xml (it was there from Facelets
installation). I didn't work either.
Then by accident I moved pasted stuff at the beginning of web.xml. It
worked (well, it started, there are a number of pending failures to be
discovered yet).
Just to avoid someone else to waste time through the same sequence,
although I did not understand why.

Thanks -- Renzo





<.... SNIP ...>

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message