是这样的!我用jsp+bean+servlet写一个登录系统
其中我用servlet作为ctrl层用来理清页面调用之间的关系也就是一个command模式,用bean来处理form的数据收集和数据检查(用户,密码),但是出现了一些问题!
login.jsp
“<center><h3>登陆</h3>
<form action="./ctrl?cmd=login" method="post">
用户:<input type="text" name="userid" size="10"><br>
密码:<input type="password" name="password" size="10"><br>
<input type="submit" value="login">
<input name="Reset" type="Reset" value="Reset">
<a href="#">注册</a>
</form>
</center>”
form action="./ctrl?cmd=login"
ctrl.java是一个servlet这样一来用户检查bean就只好在servlet中调用,(这样看起来就不舒服了!)然后再转来成功的页面!难道一定要用jsp代码在页面中转来转去吗?