<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
  </head>
  
  <body bgcolor=cyan>
  <font size =3>
  <p>请输入E-mail:<BR>
  <form action=""method=get name=form>
  <input type="text"name="client"value="1">
  <input type="submit"value="送出"name=submit>
  </form>
  <%!
   String str=request.getParameter("client");
   if(str!=null)
   {
   int index=str.indexOf("@");
   if(index==-1)
   {
   %>
   <BR>您的E-mail地址中没有@。
   <%
   }
   else
   {
   int space=str.indexOf(" ");
   if(space!=-1)
   {
   %>
   <BR>您的E-mail地址含有非法的空格。
   <%
   }
   else
   {
   int start=str.indexOf("@");
   int end =str.lastIndexOf("@");
   if(start!=end)
   {
%>  
   <BR>您的E-mail地址有两个以上的符号:@.
   <%
   }
   else
   {
   out.println("<BR>+str");
   %>
   您的E-mail地址书写正确。
   <% 
   }
   }
   }
   }
   %>
  </font>  
  </body>
</html>