bd
<%@ page contentType="text/html;charset=gb
<% //接受表單提交的字符串
/*
數據只能為a
正則表達式在做程序登陸的過程非常重要
作者
*/
String temp ="我是非法的字符";
String name = request
String pass = request
if (name==null){
name=temp;
}
if (pass==null){
pass=temp;
}
%>
<%!private boolean regex(String str){
java
java
boolean value=true;
try{
p = java
m = p
if(m
value=false;
}
}catch(Exception e){}
return value;
}
%>
<html>
<title>信息輸入表單</title>
<body>
<form action = "bd
<div align="center"><font color="#FF
<table border = "
<tr>
<td bgcolor = "yellow">用戶</td>
<td><input name = "name" type = "text" id="name"></td>
</tr>
<tr>
<td width="
<td width="
</tr>
<tr>
<td colspan = "
<input name="reset" type = "reset" value = "取消">
</td>
</tr>
<tr>
<td colspan = "
<%
//判斷:
if(!regex(name)){
out
return;//跳出程序只行
}
out
%>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20024.html