craigmcc 01/05/09 19:31:37
Modified: src/share/org/apache/struts/action ActionServlet.java
Log:
Allow initDataSources() to throw ServletException like the other
initialization methods do, to indicate a fatal initialization error.
PR: Bugzilla #1672
Submitted by: Jim Richards <[EMAIL PROTECTED]>
Revision Changes Path
1.67 +9 -5
jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java
Index: ActionServlet.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- ActionServlet.java 2001/04/23 22:45:36 1.66
+++ ActionServlet.java 2001/05/10 02:31:35 1.67
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v 1.66
2001/04/23 22:45:36 craigmcc Exp $
- * $Revision: 1.66 $
- * $Date: 2001/04/23 22:45:36 $
+ * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v 1.67
2001/05/10 02:31:35 craigmcc Exp $
+ * $Revision: 1.67 $
+ * $Date: 2001/05/10 02:31:35 $
*
* ====================================================================
*
@@ -228,7 +228,7 @@
* </ul>
*
* @author Craig R. McClanahan
- * @version $Revision: 1.66 $ $Date: 2001/04/23 22:45:36 $
+ * @version $Revision: 1.67 $ $Date: 2001/05/10 02:31:35 $
*/
public class ActionServlet
@@ -1048,8 +1048,10 @@
/**
* Initialize use of the data sources associated with this
* application (if any).
+ *
+ * @exception ServletException if a fatal initialization error occurs
*/
- protected void initDataSources() {
+ protected void initDataSources() throws ServletException {
synchronized (dataSources) {
Iterator keys = dataSources.keySet().iterator();
@@ -1063,6 +1065,8 @@
((GenericDataSource) dataSource).open();
} catch (SQLException e) {
log(internal.getMessage("initDataSource", key), e);
+ throw new ServletException
+ (internal.getMessage("initDataSource", key), e);
}
}
getServletContext().setAttribute(key, dataSource);