我写了个登录页面,填用户密码然后点登录,提交用户名密码到managedBean, 里面验证是不是跟123相符,然后返回字符串去进行页面跳转
可是一直出现
14:28:39,477 WARN [lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@69ae9f) threw exception
javax.faces.application.ViewExpiredException: viewId:/login.jsp - View /login.jsp could not be restored.
这个问题。。说session过期是怎么回事
<h:form>
<UL>
<DIV class=user_main_box>
<table>
<tr>
<td><h:outputText value="用户名" /></td>
<td><h:inputText id="userNameInput"
value="#{loginBean.userName}" required="true"/></td>
</tr>
<tr>
<td><h:outputText value="密码" /></td>
<td><h:inputSecret id="passwordInput"
value="#{loginBean.userPassword}" required="true"> </h:inputSecret></td>
</tr>
<tr>
<td><h:outputText value="登录类型" />
<td><h:selectOneMenu value="#{}">
<f:selectItem itemLabel="学生" itemValue="1" />
<f:selectItem itemLabel="教师" itemValue="2" />
<f:selectItem itemLabel="管理员" itemValue="3" />
</h:selectOneMenu></td>
</tr> </table>
</DIV>
</LI>
<LI class=user_main_r>
<h:commandButton image="loginImages/user_botton.gif"
action="#{loginBean.loginCheck}" />
</LI> </UL>
</h:form>
public String loginCheck() {
if(userName == "aaa" && userPassword == "123"){
return Constants.LOGIN_SUCCESS;
}
return Constants.LOGIN_FAILED; }
可是一直出现
14:28:39,477 WARN [lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@69ae9f) threw exception
javax.faces.application.ViewExpiredException: viewId:/login.jsp - View /login.jsp could not be restored.
这个问题。。说session过期是怎么回事
<h:form>
<UL>
<DIV class=user_main_box>
<table>
<tr>
<td><h:outputText value="用户名" /></td>
<td><h:inputText id="userNameInput"
value="#{loginBean.userName}" required="true"/></td>
</tr>
<tr>
<td><h:outputText value="密码" /></td>
<td><h:inputSecret id="passwordInput"
value="#{loginBean.userPassword}" required="true"> </h:inputSecret></td>
</tr>
<tr>
<td><h:outputText value="登录类型" />
<td><h:selectOneMenu value="#{}">
<f:selectItem itemLabel="学生" itemValue="1" />
<f:selectItem itemLabel="教师" itemValue="2" />
<f:selectItem itemLabel="管理员" itemValue="3" />
</h:selectOneMenu></td>
</tr> </table>
</DIV>
</LI>
<LI class=user_main_r>
<h:commandButton image="loginImages/user_botton.gif"
action="#{loginBean.loginCheck}" />
</LI> </UL>
</h:form>
public String loginCheck() {
if(userName == "aaa" && userPassword == "123"){
return Constants.LOGIN_SUCCESS;
}
return Constants.LOGIN_FAILED; }
解决方案 »
- 这是什么个情况???
- 用setInterval来使图片轮换问题
- 救命啊!!!!!!!!!(公司快吃我了)急!!!!!!!!!!!!!!!!
- 没办法,又是nullpointer的错误```真的快绝望了(就这么点分了)
- jfreechart令人faint~~~
- 请教.NET转J2EE的高人!
- 在进行数据修改时提示这个,是什么问题????
- 一个login.jsp提交后给一个servlet处理,处理完转到一个新的jsp,但是url还是servlet的路径,对新的页面无论什么操作都会因为找不到jsp的
- 怎样实现购物车系统?
- spring mvc 如何从前台表单传递集合参数并绑定集合对象。
- 非action类能不能实现Spring注入的方式得到service?
- 监听服务器里指定的某些页面是否访问出问题
第二:你在managedBean是怎样接收值的。
回答完毕
<managed-bean>
<managed-bean-name>loginBean</managed-bean-name>
<managed-bean-class>sas.view.user.LoginBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>网页上不是有value="#{loginBean.userPassword}" 和value="#{loginBean.userName}"吗
然后点那个commandButton
这样不能提交的吗 = = 新手 不太懂啊