使用JSP + JAVABEAN + XML 开发的一个例子__教程 |
|
日期:2007-5-20 1:24:45 人气:185 [大 中 小] |
|
|
|
<td><img src="http://www.mbsky.com/infoview/images/top_r2.GIF" width="294" height="22"></td> </tr> </table> <br> <br> <table width="300" border="0" cellspacing="1" cellpadding="0" > <tr> <td height="200" valign="top" align="center"> <p align="center"> <table width="100%" border="0" cellspacing="1" cellpadding="5" bgcolor=#999999 class=a9px> <tr> <td bgcolor="#efefef">餐饮系统登录</td> </tr> <tr> <td bgcolor="#FFFFFF" valign="top" align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <form name=dataform method=post action=''canyin/jsp/loginjudge.jsp''> <tr> <td width="100"><b>登录名:</b></td> <td> <input maxlength=16 name="username" class=stedit value="joard"> </td> </tr> <tr> <td width="100"><b>密码:</b></td> <td> <input class=stedit maxlength=16 name="userpass" type=password value="oddworld"> </td> </tr> </form> </table> <br> <table border=0 cellpadding=0 cellspacing=0> <tbody> <tr> <td> <input class=stbtm name=update onClick="javascript:if (checkform()==false);" type=button value="登 录"> </td> <td> </td> <td> <input class=stbtm name=Submit onClick="javascript:window.location.href=''index.asp?myjoke=1'';" type=button value="修改密码"> </td> <td> </td> </tr> </tbody> </table> <br> </td> </tr> </table> </td> </tr> </table> </div> </body> </html> <SCRIPT language=javascript> <!-- function checkform() { var Checkblank = /^(\s*|(\ )|(\.))*$/; if (Checkblank.test(dataform.username.value)) { alert("登录名不能为空!"); return false; }
if (Checkblank.test(dataform.userpass.value)) { alert("密码不能为空!"); return false; }
window.dataform.submit();
} -->
</SCRIPT>
说明:把用户名称和用户密码提交到/tomcat/webapps/canyin/jsp/loginjudge.jsp
/tomcat/webapps/canyin/WEB-INF/classes/canyin/checkSessionBean.class (代码是相应的java 文件)
package canyin;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletRequest;
public class checkSessionBean {
private boolean bolCheckPass=false; private HttpServletRequest request = null;
public boolean checkSessionBean(HttpServletRequest request,String strSessionName,String strCheckValue){ public boolean checkSessionBean(HttpServletRequest request){ HttpSession session = request.getSession(false); |
|
出处:本站原创 作者:佚名 |
|
|