现在有个登陆界面<form action="login.do" method = "post" onsubmit="return checkForm(this)">
<body >
<font face = "楷体_GB2312" color="#0000a0">
产品查询服务平台</font><br><br>
<table>
<tr>
<td><font color="#800000">用户名:</font>
</td>
<td><input type = text name = "username">
</td>
</tr>
<tr>
<td><font color="#800000">密码:</font>
</td>
<td><input type = password name = "password">
</td>
</tr>
<tr conspan = 3>
<td>
<input type="submit" name="submit" value="登陆" >
</td>
<td>
<input type = "reset" name = "reset" value = "取消" >
</td>
</tr>
</table><br>
</body>
</form>
</html>
<script language="javascript">
function checkForm(form){
if(isEmpity(form.username.value))
{
alert("请输入用户名!");
return false;
}
if(isEmpity(form.password.value))
{
alert("请输入密码!");
return false;
}
return true;
}
function isEmpity(str){
if(str==null||str.length==0){
return ture;
}else
return false;
}
</script>其中方法为
<action-mappings>
<action path="/login"
type="com.struts.bean.LoginBean"
scope="session">
<forward name="success" path="/name.jsp" />
<forward name="failure" path="/LogicPack/FailedPage.jsp" />
</action>跳转到 name.jsp 后,我再从地址栏里边输入 访问 name.jsp 后 session的值 就是null 为什么阿????
<body >
<font face = "楷体_GB2312" color="#0000a0">
产品查询服务平台</font><br><br>
<table>
<tr>
<td><font color="#800000">用户名:</font>
</td>
<td><input type = text name = "username">
</td>
</tr>
<tr>
<td><font color="#800000">密码:</font>
</td>
<td><input type = password name = "password">
</td>
</tr>
<tr conspan = 3>
<td>
<input type="submit" name="submit" value="登陆" >
</td>
<td>
<input type = "reset" name = "reset" value = "取消" >
</td>
</tr>
</table><br>
</body>
</form>
</html>
<script language="javascript">
function checkForm(form){
if(isEmpity(form.username.value))
{
alert("请输入用户名!");
return false;
}
if(isEmpity(form.password.value))
{
alert("请输入密码!");
return false;
}
return true;
}
function isEmpity(str){
if(str==null||str.length==0){
return ture;
}else
return false;
}
</script>其中方法为
<action-mappings>
<action path="/login"
type="com.struts.bean.LoginBean"
scope="session">
<forward name="success" path="/name.jsp" />
<forward name="failure" path="/LogicPack/FailedPage.jsp" />
</action>跳转到 name.jsp 后,我再从地址栏里边输入 访问 name.jsp 后 session的值 就是null 为什么阿????
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货