cedric 2002/07/10 07:52:46 Modified: src/share/org/apache/struts/action ActionServlet.java Log: Minor modifications to facilitate TilesPlugin initialization : - Let propagate ServletException from initApplicationPlugin(). Such exception can be thrown by plugin initialization. - Make plugin configurations list available before plugin initializations. This allows a plugin to find its original configuration object. - Freeze AppConfig objects AFTER plugin initialization. This let a chance to plugin to change a particular configuration. Tiles use this to set the request processor from the tiles plugin. Revision Changes Path 1.114 +14 -7 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.113 retrieving revision 1.114 diff -u -r1.113 -r1.114 --- ActionServlet.java 9 Jul 2002 23:57:05 -0000 1.113 +++ ActionServlet.java 10 Jul 2002 14:52:46 -0000 1.114 @@ -448,6 +448,7 @@ initApplicationMessageResources(ac); initApplicationDataSources(ac); initApplicationPlugIns(ac); + ac.freeze(); Enumeration names = getServletConfig().getInitParameterNames(); while (names.hasMoreElements()) { String name = (String) names.nextElement(); @@ -460,6 +461,7 @@ initApplicationMessageResources(ac); initApplicationDataSources(ac); initApplicationPlugIns(ac); + ac.freeze(); } destroyConfigDigester(); @@ -873,7 +875,7 @@ } // Return the completed configuration object - config.freeze(); + //config.freeze(); // Now done after plugins init return (config); } @@ -956,6 +958,9 @@ PlugInConfig plugInConfigs[] = config.findPlugInConfigs(); PlugIn plugIns[] = new PlugIn[plugInConfigs.length]; + + getServletContext().setAttribute + (Action.PLUG_INS_KEY + config.getPrefix(), plugIns); for (int i = 0; i < plugIns.length; i++) { try { plugIns[i] = (PlugIn) @@ -964,14 +969,16 @@ BeanUtils.populate(plugIns[i], plugInConfigs[i].getProperties()); plugIns[i].init(this, config); + } catch (ServletException e) { + // Lets propagate + throw e; } catch (Exception e) { + e.printStackTrace(); throw new UnavailableException (internal.getMessage("plugIn.init", plugInConfigs[i].getClassName())); } } - getServletContext().setAttribute - (Action.PLUG_INS_KEY + config.getPrefix(), plugIns); }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>