Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 在呈现响应后设置ViewHandler的尝试是非法的_Jsf_Richfaces_Facelets - Fatal编程技术网

Jsf 在呈现响应后设置ViewHandler的尝试是非法的

Jsf 在呈现响应后设置ViewHandler的尝试是非法的,jsf,richfaces,facelets,Jsf,Richfaces,Facelets,我在登录页面上遇到以下错误。 在呈现响应后设置ViewHandler的尝试是非法的 我正在使用Richfaces 3.3.3和facelets以及jsf和tomcat 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-i

我在登录页面上遇到以下错误。 在呈现响应后设置ViewHandler的尝试是非法的

我正在使用Richfaces 3.3.3和facelets以及jsf和tomcat

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">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <!-- Start - Richfaces Configuration-->
    <!-- Plugging the "Blue Sky" skin into the project -->
    <context-param>
        <param-name>org.richfaces.SKIN</param-name>
        <param-value>blueSky</param-value>
    </context-param>
    <!-- Making the RichFaces skin spread to standard HTML controls -->
    <context-param>
        <param-name>org.richfaces.CONTROL_SKINNING</param-name>
        <param-value>enable</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
        <param-value>true</param-value>
    </context-param>
    <filter>
        <display-name>RichFaces Filter</display-name>
        <filter-name>richfaces</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>richfaces</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <!-- End - Richfaces Configuration-->
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>

javax.faces.PROJECT_阶段
发展
org.richfaces.SKIN
蓝调的
org.richfaces.CONTROL\u蒙皮
使可能
javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER
真的
RichFaces过滤器
富人
org.ajax4jsf.Filter
富人
Facesservlet
要求
向前地
包括
Facesservlet
javax.faces.webapp.FacesServlet
Facesservlet
*.jsf
index.jsp
index.html
faces-config.xml

<?xml version="1.0"?>
<faces-config 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-facesconfig_2_0.xsd"
version="2.0 " metadata-complete="false">
<navigation-rule>
    <from-view-id>/login.xhtml</from-view-id>
    <navigation-case>
        <from-outcome>success</from-outcome>
        <to-view-id>/main.xhtml</to-view-id>
        <redirect />
    </navigation-case>
    <navigation-case>
        <from-outcome>fail</from-outcome>
        <to-view-id>/login.jsp</to-view-id>
        <redirect />
    </navigation-case>
</navigation-rule>
<navigation-rule>
    <from-view-id>/main.xhtml</from-view-id>
    <navigation-case>
        <from-outcome>viewScreen</from-outcome>
        <to-view-id>/view.xhtml</to-view-id>
        <redirect />
    </navigation-case>
</navigation-rule>
<managed-bean>
    <managed-bean-name>mainBean</managed-bean-name>
    <managed-bean-class>coreservlets.MainBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
        <property-name>sessionMap</property-name>
        <value>#{sessionScope}</value>
    </managed-property>
    <managed-property>
        <property-name>facesContext</property-name>
        <value>#{facesContext}</value>
    </managed-property>
</managed-bean>
<managed-bean>
    <managed-bean-name>loginBean</managed-bean-name>
    <managed-bean-class>coreservlets.LoginBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>

    <managed-property>
        <property-name>sessionMap</property-name>
        <value>#{sessionScope}</value>
    </managed-property>
    <managed-property>
        <property-name>facesContext</property-name>
        <value>#{facesContext}</value>
    </managed-property>
</managed-bean>
</faces-config>

/login.xhtml
成功
/main.xhtml
失败
/login.jsp
/main.xhtml
视屏
/view.xhtml
菜豆
coreservlets.MainBean
要求
会话地图
#{会话范围}
facesContext
#{facesContext}
罗根宾
coreservlets.LoginBean
要求
会话地图
#{会话范围}
facesContext
#{facesContext}

请建议尝试将faces-config.xml中的视图处理程序设置更改为

<application>
  <view-handler>org.ajax4jsf.application.AjaxViewHandler</view-handler>
</application>

您解决了这个问题吗?如果是这样的话,也许你可以发布你自己的答案。Thnx。