<html>
<head>
<title>login</title>
<meta http-equiv="Content-Type" content="textml; charset=gbk">
<style type="text/css">
input {
font-family:"黑体";
alien:center;
font-size:"小四";
color:"red";
font-style:italic;
}
</style>
<script type="text/javascript">
function check_name(){
if (myform.use.value == "") {
alert("请填写您的用户名!");
myform.use.focus();
return false;
}
else if(myform.use.value.length<2 || myform.use.value.length>20){
alert("用户名的长度必须在2-20之间!");
myform.use.focus();
return false ;
}
else  if(myform.use.value == "11111111" && myform.password.value == "33333333"){
 window.location.href="lx2_1.jsp";
}
else {
alert("密码错误");
}
}
</script></head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- Save for Web Slices (login.jpg) -->
<form name="myform" method="post" action="">
<table id="__01" width="1001" height="581" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="8">
<img src="images/login_01.gif" width="1000" height="229" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="229" alt=""></td>
</tr>
<tr>
<td rowspan="11">
<img src="images/login_02.gif" width="712" height="351" alt=""></td>
 <td colspan="5" width="169" height="19">
    <input type="text" name="use"></td>
<td rowspan="11">
<img src="images/login_04.gif" width="117" height="351" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="20" alt=""></td>
  </tr>
<tr>
<td colspan="6">
<img src="images/login_05.gif" width="171" height="16" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="16" alt=""></td>
</tr>
<tr>
<td colspan="7" width="171" height="22">
    <input type="text" name="password"> </td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="20" alt=""></td>
</tr>
<tr>
<td colspan="6">
<img src="images/login_07.gif" width="171" height="15" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="15" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/login_08.gif" width="54" height="18" alt=""></td>
<td colspan="4" rowspan="4">
<img src="images/login_09.gif" width="117" height="58" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="18" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/login_10.gif" width="54" height="15" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="15" alt=""></td>
</tr>
<tr>
<td>
<img src="images/login_11.gif" width="15" height="12" alt=""></td>
<td rowspan="2">
<img src="images/login_12.gif" width="39" height="25" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="12" alt=""></td>
</tr>
<tr>
<td rowspan="4">
<img src="images/login_13.gif" width="15" height="235" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="13" alt=""></td>
</tr>
<tr>
<td colspan="2" rowspan="2">
<img src="images/login_14.gif" width="51" height="19" alt="" onClick="check_name()"></td>
<td rowspan="3">
<img src="images/login_15.gif" width="15" height="222" alt=""></td>
<td>
<img src="images/login_16.gif" width="45" height="14" alt="" onClick="document.myform.reset()"></td>
<td rowspan="3">
<img src="images/login_17.gif" width="45" height="222" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="14" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="images/login_18.gif" width="45" height="208" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="13" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/login_19.gif" width="51" height="195" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="1" height="195" alt=""></td>
</tr>
<tr>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="712" height="1" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="15" height="1" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="39" height="1" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="12" height="1" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="15" height="1" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="45" height="1" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="45" height="1" alt=""></td>
<td>
<img src="images/&#x5206;&#x9694;&#x7b26;.gif" width="117" height="1" alt=""></td>
<td></td>
</tr>
</table>
</form>
<!-- End Save for Web Slices -->
</body>
</html>

解决方案 »

  1.   

    jsp页面的头文件加了么:
    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
    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>your jsp</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">
      </head>
      

  2.   

    你可以将你的代码放在jsp页面里运行下,就知道了
      

  3.   

    <%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%!int i=0;String name[]={"丁一","倪二","张三","李四","王五"}; String mood[]={"一般","差"};
     double wage[]={560.0,640.0,720,800,1200};
     %>
    <html>
      <head>
        <base href="<%=basePath%>">
        
        <title>
        101304045:<%=(new java.util.Date()).toLocaleString()%>
        </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>
     
      <table width="163" border="1">
          <tr>
            <td width="66" height="37"> 姓名</td>
            <td width="81">   实际工资</td>
             <td width="81">   心情状态</td>
          </tr>
          <%  for(int i=0;i<5;i++){ %>
          <tr>
            <td height="31"><%=name[i] %></td>
            <td><%=wage[i] %></td> 
             <td>
             <%if(wage[i]>=800){%>
             <%=mood[0] %> <%} %>
              <%if(wage[i]<800){%>
             <%=mood[1] %> <%} %>
               </td>
        </tr>
             <% } %> 
          
           </table>  
    </body>
    </html>
      

  4.   

    <%!int i=0;String name[]={"丁一","倪二","张三","李四","王五"}; String mood[]={"一般","差"};
     double wage[]={560.0,640.0,720,800,1200};
     %>
    去掉前面感叹号!!!!