我已经完成了我的登录验证。它工作正常,但输入正确username
and后password
,没有执行任何操作,成功登录后也没有打开 JSP 页面。
这是我的登录表单:
<s:form validate="true" action="login">
<br>
<table class="bg" cellspacing="0">
<tr class="logindiv">
<td >
</td>`enter code here`
<td>
Sign In
</td>
</tr>
<tr>
<td>
<s:textfield label="Username" name="obj2.user" cssStyle="height:25px; width:150px;"></s:textfield>
</td>
</tr>
<tr>
<td>
<s:password label="Password" name="obj2.pass" cssStyle="height:25px;width:150px;"></s:password>
</td>
</tr>
<tr>
<td>
<center>
<s:submit value="Login" cssClass="login"></s:submit>
</center>
</td>
</tr>
</table>
</s:form>
struts.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<package name="default" namespace="/" extends="struts-default">
<action name="login" class="IndianUserActionModule.indianAction" method="Login">
<result name="input">index.jsp</result>
<result name="success">IndianHome.jsp</result>
<result name="fail">index.jsp</result>
</action>
</package>
</struts>