找不到视图标识符的已保存视图状态 [英] No saved view state could be found for the view identifier

查看:159
本文介绍了找不到视图标识符的已保存视图状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Jetty服务器上运行JSF应用程序时,它运行良好.

When I was running my JSF application on Jetty server it was running fine.

但是当我将其移至Weblogic服务器时,它开始给我这个错误.

But as I moved this to Weblogic server, it started giving me this error.

javax.faces.application.ViewExpiredException: /wsListing.xhtmlNo saved view state could be found for the view identifier: /wsListing.xhtml
at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:132)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1398)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

wsListing.xhtml如下:

wsListing.xhtml is given below:

  <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui" xmlns:lang="en">

<f:view xmlns:c="http://java.sun.com/jstl/core"
    xmlns:s="http://www.springframework.org/tags"
    xmlns:form="http://www.springframework.org/tags/form">
    <h:head>
        <h:outputStylesheet library="css" name="../resources/css/style.css"
            target="head" />
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Test Client</title>
        <link rel="shortcut icon" href="../resources/images/favicon.ico" />
        <link rel="stylesheet" href="../resources/css/style.css"
            type="text/css" media="all" />
    </h:head>
    <h:body>
        <ui:include src="header.xhtml" />
        <div id="home-training-container">
            <h:form>
                <table align="center" border="1">
                    <tr>
                        <td><h:commandLink value="First Web Service"
                                action="#{wsListingBean.action}">
                                <f:setPropertyActionListener
                                    target="#{wsListingBean.webServiceId}" value="abcService" />
                            </h:commandLink></td>
                    </tr>
                    <tr>
                        <td><h:commandLink value="Second Web Service"
                                action="#{wsListingBean.action}">
                                <f:setPropertyActionListener
                                    target="#{wsListingBean.webServiceId}" value="filterabc" />
                            </h:commandLink></td>
                    </tr>
                    <tr>
                        <td>Third Web Service</td>
                    </tr>
                    <tr>
                        <td>Fourth Web Service</td>
                    </tr>
                    <tr>
                        <td>Fifth Web Service</td>
                    </tr>
                </table>
            </h:form>
        </div>
        <ui:include src="footer.xhtml" />
    </h:body>
</f:view>
</html>

当我单击任何命令链接时,就会出现此问题:

When I click on any of the command links then this issue is coming:

<h:commandLink value="First Web Service"
                                    action="#{wsListingBean.action}">
                                    <f:setPropertyActionListener
                                        target="#{wsListingBean.webServiceId}" value="abcService" />

有人对这个视图状态有什么想法吗?

Anyone having any idea regarding what this view state is?

推荐答案

您是否将web.xml中的PROJECT_STAGE设置为开发"?如果是这样,您可以将其切换到生产"并查看问题是否消失了吗?我在WebLogic上收到了类似的错误消息(如果不是相同的话),并且相信该更改可以解决该问题.

Do you have PROJECT_STAGE in web.xml set to Development? If so, can you switch it to Production and see if the problem goes away? I had a similar, if not the same, error message on WebLogic and believe that that change fixed it.

这篇关于找不到视图标识符的已保存视图状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆