|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ActionServlet | Line # 52 | 4 | 2 | 0% |
0.0
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
No Tests | |||
1 | /* | |
2 | * The SmartWeb Framework | |
3 | * Copyright (C) 2004-2006 | |
4 | * | |
5 | * This library is free software; you can redistribute it and/or | |
6 | * modify it under the terms of the GNU Lesser General Public | |
7 | * License as published by the Free Software Foundation; either | |
8 | * version 2.1 of the License, or (at your option) any later version. | |
9 | * | |
10 | * This library is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this library; if not, write to the Free Software | |
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
18 | * | |
19 | * For further informations on the SmartWeb Framework please visit | |
20 | * | |
21 | * http://smartweb.sourceforge.net | |
22 | */ | |
23 | package net.smartlab.web; | |
24 | ||
25 | import java.io.IOException; | |
26 | ||
27 | import javax.servlet.ServletException; | |
28 | import javax.servlet.http.HttpServletRequest; | |
29 | import javax.servlet.http.HttpServletResponse; | |
30 | ||
31 | /** | |
32 | * The <i>front controller</i> class of the framework. It extends the Jakarta | |
33 | * Struts implementation to ensure the correct closure of the Hibernate session. | |
34 | * | |
35 | * @web.servlet name="action" load-on-startup="1" | |
36 | * @web.servlet-init-param name="config" value="/WEB-INF/struts.xml" | |
37 | * @web.servlet-mapping url-pattern="*.do" | |
38 | * @author rlogiacco | |
39 | * @link asda | |
40 | * @web.servlet name="action" load-on-startup="1" | |
41 | * @web.servlet-init-param name="config" value="/WEB-INF/struts.xml" | |
42 | * @web.servlet-mapping url-pattern="*.do" | |
43 | * @uml.dependency supplier="net.smartlab.web.Action" | |
44 | * @uml.dependency supplier="net.smartlab.web.Domain" | |
45 | * @web.servlet name="action" load-on-startup="1" | |
46 | * @web.servlet-init-param name="config" value="/WEB-INF/struts.xml" | |
47 | * @web.servlet-mapping url-pattern="*.do" | |
48 | * @web.servlet name="action" load-on-startup="1" | |
49 | * @web.servlet-init-param name="config" value="/WEB-INF/struts.xml" | |
50 | * @web.servlet-mapping url-pattern="*.do" | |
51 | */ | |
52 | public class ActionServlet extends org.apache.struts.action.ActionServlet { | |
53 | ||
54 | private static final long serialVersionUID = 6243504848590158405L; | |
55 | ||
56 | ||
57 | /** | |
58 | * @see org.apache.struts.action.ActionServlet#process(javax.servlet.http.HttpServletRequest, | |
59 | * javax.servlet.http.HttpServletResponse) | |
60 | */ | |
61 | 0 | protected void process(HttpServletRequest request, HttpServletResponse response) throws IOException, |
62 | ServletException { | |
63 | 0 | try { |
64 | 0 | super.process(request, response); |
65 | } finally { | |
66 | 0 | try { |
67 | 0 | BusinessObjectFactory.close(); |
68 | } catch (DAOException daoe) { | |
69 | super.getServletContext().log("failed to close session", daoe); | |
70 | } | |
71 | } | |
72 | } | |
73 | } |
|