Struts 2 例子
<body> <div align="center" class="english"> <table cellspacing="0" width="100%" align="center" border="0"> <tbody> <tr> <td align="middle"><div align="center"> </div></td> </tr> </tbody> </table> <p> </p> <form name="form1" id="form1" method="post" action="logon.jsp"> <h1>图书馆管理系统登录</h1> <table width="356" border="0"> <tr> <td width="135" height="33">用户类别:</td> <td width="211"><select name="select" class="input1"> <option value="teacher">管理员</option> <option value="student" selected="selected">学生</option> </select></td> </tr> <tr> <td height="30">帐号:</td> <td><input name="uid" type="text" class="input1" /></td> </tr> <tr> <td height="30" class="font2">密码:</td> <td><input name="pwd" type="password" class="input1" /></td> </tr> </table> <p> </p> <table width="200" border="0"> <tr> <td><input type="submit" name="Submit" value="登陆" /></td> <td><input type="reset" name="Submit2" value="重设" /></td> </tr> </table> <p> </p> </form> <p><a href="logon.jsp">注册新用户</a></p> <p> </p> <table height="4" cellspacing="0" width="640" align="center" border="0"> <tbody> <tr> <td valign="bottom" width="787" bgcolor="#0b5a7e" height="4"></td> </tr> </tbody> </table> </body>
<body> <% String a="借阅成功"; String c="select * from tsb"; ResultSet rs=DBHelper.getResultSet(c); out.print("<table border='1' >"); out.print("<tr><td>图书编号</td><td>图书名字</td><td>作者</td><td>出版社</td><td></td></tr>"); while(rs.next()){ out.print("<tr>"); out.print("<td>"+rs.getString("TS_bianhao")+"</td>"); out.print("<td>"+rs.getString("TS_name")+"</td>"); out.print("<td>"+rs.getString("TS_zuozhe")+"</td>"); out.print("<td>"+rs.getString("TS_adress")+"</td>"); out.print("<td><a href='#'>借阅</a></td>"); out.print("</tr>"); } out.print("</table>"); %> </body>