You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Adrian Hine <a....@mrag.co.uk> on 2005/03/30 11:34:51 UTC

Myfaces Extension Filter

Could someone please help me with my problem setting up using myfaces
extensions. I'm trying to use the myfaces inputCalendar component and am
trying to use it in the Sun Studio Creator environment. I see from
previous mails that I should set up an extensions filter in web.xml.
However I'm getting an error message when running the app suggesting the
filter isn't setup correctly (see below for error, web.xml & the jsp
page). I've taken the filter from the myfaces-examples app.

 

Also I'm not entirely clear on which jars are required, I'm only
including myfaces.jar and myfaces-extensions.jar in the apps WEB-INF/lib
directory. Are there any other I need to use?

 

Many Thanks,

 

Adrian

 

 

ERROR MESSAGE:

 

[#|2005-03-26T09:40:20.359+0000|SEVERE|sun-appserver-pe8.0.0_01|javax.en
terprise.system.tools.deployment|_ThreadID=11;|Invalid Deployment
Descriptors in archive c:\Documents and Settings\Administrator\My
Documents\Creator\Projects\Time3\build in deployment descriptor file
WEB-INF/web.xml 

Error at line 132 Column 11 -- The content of element type "web-app"
must match
"(icon?,display-name?,description?,distributable?,context-param*,filter*
,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mim
e-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,reso
urce-ref*,security-constraint*,login-config?,security-role*,env-entry*,e
jb-ref*,ejb-local-ref*)". |#]

 

[#|2005-03-26T09:40:20.359+0000|SEVERE|sun-appserver-pe8.0.0_01|javax.en
terprise.system.tools.deployment|_ThreadID=11;|The content of element
type "web-app" must match
"(icon?,display-name?,description?,distributable?,context-param*,filter*
,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mim
e-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,reso
urce-ref*,security-constraint*,login-config?,security-role*,env-entry*,e
jb-ref*,ejb-local-ref*)".|#]

 

[#|2005-03-26T09:40:20.359+0000|WARNING|sun-appserver-pe8.0.0_01|javax.e
nterprise.system.tools.deployment|_ThreadID=11;|Deployment Error

com.sun.enterprise.deployment.backend.IASDeploymentException: Error
loading deployment descriptors for _time3 Line 132 Column 11 -- The
content of element type "web-app" must match
"(icon?,display-name?,description?,distributable?,context-param*,filter*
,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mim
e-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,reso
urce-ref*,security-constraint*,login-config?,security-role*,env-entry*,e
jb-ref*,ejb-local-ref*)".

            at
com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.
java:289)

 

etc....

 

 

 

WEB.XML FILE

 

<?xml version="1.0"?>

 

<!--

 Copyright 2002, 2003 Sun Microsystems, Inc. All Rights Reserved.

-->

 

<!DOCTYPE web-app PUBLIC

  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

  "http://java.sun.com/dtd/web-app_2_3.dtd">

 

<web-app>

 

    <context-param>

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

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

    </context-param>

 

    <context-param>

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

 
<param-value>/WEB-INF/navigation.xml,/WEB-INF/managed-beans.xml</param-v
alue>

    </context-param>

 

    <context-param>

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

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

    </context-param>

 

    <context-param>

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

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

    </context-param>

 

    <!-- Faces Servlet -->

    <servlet>

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

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

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

    </servlet>

 

    <!-- Error Handler Servlet -->

    <servlet>

            <servlet-name>ExceptionHandlerServlet</servlet-name>

 
<servlet-class>com.sun.errorhandler.ExceptionHandler</servlet-class>

            <init-param>

                <param-name>errorHost</param-name>

                <param-value>localhost</param-value>

            </init-param>

            <init-param>

                <param-name>errorPort</param-name>

                <param-value>4444</param-value>

            </init-param>

    </servlet>

 

    <!-- Faces Servlet Mapping -->

    <servlet-mapping>

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

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

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

    </servlet-mapping>

 

    <!-- Error Handler Servlet Mapping -->

    <servlet-mapping>

        <servlet-name>ExceptionHandlerServlet</servlet-name>

        <url-pattern>/error/ExceptionHandler</url-pattern>

    </servlet-mapping>

 

    <!-- Welcome File List -->

    <welcome-file-list>

        <welcome-file>faces/Page1.jsp</welcome-file>

    </welcome-file-list>

 

    <!-- Catch  ServletException -->

    <error-page>

        <exception-type>javax.servlet.ServletException</exception-type>

        <location>/error/ExceptionHandler</location>

    </error-page>

 

    <!-- Catch  IOException -->

    <error-page>

        <exception-type>java.io.IOException</exception-type>

        <location>/error/ExceptionHandler</location>

    </error-page>

 

    <!-- Catch  FacesException -->

    <error-page>

        <exception-type>javax.faces.FacesException</exception-type>

        <location>/error/ExceptionHandler</location>

    </error-page>

 

    <!-- Extensions Filter -->

              <filter>

                        <filter-name>extensionsFilter</filter-name>

                        <filter-class>

 
org.apache.myfaces.component.html.util.ExtensionsFilter

                        </filter-class>

                        <init-param>

 
<param-name>uploadMaxFileSize</param-name>

                                    <param-value>100m</param-value>

                                    <description>

                                                Set the size limit for
uploaded files.

                                                Format: 10 - 10 bytes
10k - 10 KB 10m - 10 MB 1g - 1 GB

                                    </description>

                        </init-param>

                        <init-param>

 
<param-name>uploadThresholdSize</param-name>

                                    <param-value>100k</param-value>

                                    <description>

                                                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

                                    </description>

                        </init-param>

                        <!-- <init-param>

 
<param-name>uploadRepositoryPath</param-name>

                                    <param-value>/temp</param-value>

                                    <description>Set the path where the
intermediary files will be stored.

                                    </description>

                                    </init-param>-->

            </filter>

 

            <filter-mapping>

                        <filter-name>extensionsFilter</filter-name>

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

            </filter-mapping>

            <filter-mapping>

                        <filter-name>extensionsFilter</filter-name>

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

            </filter-mapping>

 

 

</web-app>

 

 

MY JSP PAGE:

 

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

<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:x="http://myfaces.apache.org/extensions">

    <jsp:directive.page contentType="text/html;charset=UTF-8"
pageEncoding="UTF-8"/>

    <jsp:text><![CDATA[

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

]]></jsp:text>

    <f:view>

        <html lang="en-GB" xml:lang="en-GB">

            <head>

                <meta content="no-cache" http-equiv="Cache-Control"/>

                <meta content="no-cache" http-equiv="Pragma"/>

                <title>Page1 Title</title>

                <link href="resources/stylesheet.css" rel="stylesheet"
type="text/css"/>

            </head>

            <body style="-rave-layout: grid">

                <h:form binding="#{Page1.form1}" id="form1">

                    <h:outputText binding="#{Page1.outputText1}"
id="outputText1" style="height: 19px; left: 72px; top: 96px; position:
absolute; width: 144px" value="Test Page"/>

                    

                    <x:inputCalendar id="calendar1" style="left: 700px;
top: 96px; position: absolute" value="#{Page1.calendarDate}"/>

                

                </h:form>

            </body>

        </html>

    </f:view>

</jsp:root> 
 
This e-mail is sent by the above named individual, a representative of MRAG Ltd. The 
contents of the message represent the views of the individual and may not necessarily 
reflect those of the company. The above information transmitted, is intended only for the 
person or entity to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or taking of any action
in reliance upon, this information by persons or entities other than the intended recipient 
is prohibited. If you received this in error, please contact the sender and delete the 
material from any computer. MRAG Ltd reserves the right to monitor outgoing and incoming 
e-mails and other telecommunications on its e-mail and telecommunications systems.