eption e){
62 System.out.println("UserDaoImpl.isExist()方法发生异常:");
63 e.printStackTrace();
64 return 0; //异常时返回0
65 }finally {
66 util.closeSession(session);
67 }
68 }
69}
70
Struts 2.0屁栽Hibernate 3.2蝕窟廣過鞠村狼由(5)
扮寂:2011-09-14 伉知繰唹
6、壓web.xml嶄塘崔Struts 2.0屶隔?
1<?xml version="1.0" encoding="UTF-8"?>
2<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
5 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
6
7 <!-- 喘狛陀匂塘崔 Struts2屶隔 -->
8 <filter>
9 <filter-name>struts2</filter -name>
10 <filter-class>
11 org.apache.struts2.dispatcher.FilterDispatcher
12 </filter-class>
13 </filter>
14 <filter-mapping>
15 <filter- name>struts2</filter-name>
16 <url-pattern>/*</url- pattern>
17 </filter-mapping>
18
19 <welcome-file-list>
20 <welcome-file>login.jsp</welcome-file>
21 </welcome-file- list>
22</web-app> 7、鞠村匈中login.jsp旗鷹泌和?
1<%@ page language="java" import="java.util.*" pageEncoding="gbk"% >
2<%@ taglib prefix="s" uri="/struts-tags" %>
3<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4<html>
5 <head>
6
7 <title>Login Page</title>
8 </head>
9
10 <body>
11 <p><a href="register.jsp">喘薩廣過</a>|喘薩鞠村 </p>
12 <s:form action="loginAction" theme="simple">
13 <table>
14 <tr>
15 <td style="text-align:right">
16 嬲催
17 </td>
18 <td>
19 <s:textfield name="name" label="嬲催" />
20
21 </td>
22 </tr>
23 <tr>
24 <td style="text -align:right">
25 畜鷹
26 </td>
27 <td>
28 <s:password name="pwd" label="畜鷹" />
29 </td>
30 </tr>
31 <tr>
32 <td style="text- align:right">
33 刮屬鷹
34 </td>
35 <td>
36 <s:textfield name="inputCertCode" label="刮屬鷹&
|