net.smartlab.web.ActionServlet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smartweb Show documentation
Show all versions of smartweb Show documentation
SmartWeb is a web application development meta framework based on Jakarta Struts, Hibernate and other open source frameworks and libraries.
/*
* The SmartWeb Framework
* Copyright (C) 2004-2006
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* For further informations on the SmartWeb Framework please visit
*
* http://smartweb.sourceforge.net
*/
package net.smartlab.web;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* The front controller class of the framework. It extends the Jakarta
* Struts implementation to ensure the correct closure of the Hibernate session.
*
* @author rlogiacco
*
* @uml.dependency supplier="net.smartlab.web.Action"
* @uml.dependency supplier="net.smartlab.web.Domain"
*
* @web.servlet name="action" load-on-startup="1"
* @web.servlet-init-param name="config" value="/WEB-INF/struts.xml"
* @web.servlet-mapping url-pattern="*.do"
*/
public class ActionServlet extends org.apache.struts.action.ActionServlet {
private static final long serialVersionUID = 6243504848590158405L;
/**
* @see org.apache.struts.action.ActionServlet#process(javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/
protected void process(HttpServletRequest request, HttpServletResponse response) throws IOException,
ServletException {
try {
super.process(request, response);
} finally {
try {
BusinessObjectFactory.close();
} catch (DAOException daoe) {
super.getServletContext().log("failed to close session", daoe);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy