0

我在我的 JSF1.2 webapp 中遇到了问题。

我在我的应用程序中使用 Tomahawk 已经很长时间了,我之前从未遇到过这个错误:

javax.servlet.ServletException: ExtensionsFilter not correctly configured. Resource mapping missing. Resources cant be delivered. Please see: http://myfaces.apache.org/tomahawk/extensionsFilter.html
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)

它出现在我在我<t:panelTabbedPane>的一个 JSF 页面中添加了一个组件之后。这是一段代码:

<h:form id="uploadForm" enctype="multipart/form-data">
    <t:panelTabbedPane>
        <t:panelTab label="label1">
            //Some content.
        </t:panelTab>
        <t:panelTab label="label2">
            //More content.
        </t:panelTab>
    </t:panelTabbedPane>
</h:form>

另外,我发布了我的 web.xml 配置的一部分:

<filter>
    <filter-name>extensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
    <init-param>
        <description>Set the size limit for uploaded files.
            Format: 10 - 10 bytes
                    10k - 10 KB
                    10m - 10 MB
                    1g - 1 GB
        </description>
        <param-name>uploadMaxFileSize</param-name>
        <param-value>5m</param-value>
    </init-param>
    <init-param>
        <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>
        <param-name>uploadThresholdSize</param-name>
        <param-value>100k</param-value>
    </init-param>
    <init-param>
        <description>
            Set the path where the intermediary files will be stored.
        </description>
        <param-name>uploadRepositoryPath</param-name>
        <param-value>d:/temp</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>
(...)
<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>*.jsf</url-pattern>
</servlet-mapping>

难道我做错了什么?先感谢您。

4

1 回答 1

-2

将资源的过滤器部分添加到 web.xml

<filter-mapping>
<filter-name>Extensions Filter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>

于 2014-05-27T05:48:20.863 回答