Permalink
Browse files

Fix ActionServlet30 formatting. Removed @author.

I think Michael has already resolved the automatic (Eclipse) code
formatting problem in another commit.

Regarding formatting, see:
http://mifosforge.jira.com/wiki/display/MIFOS/Coding+Standards#CodingStandards-Sourcecode

Regarding @author, see:
http://mifosforge.jira.com/wiki/display/MIFOS/Team+Collaboration
Specifically, "No code ownership - we all own the code"
  • Loading branch information...
1 parent de61c25 commit 63167437b3b1eaedb2fad061624fad0ee83af60c @meonkeys meonkeys committed Feb 3, 2011
Showing with 36 additions and 39 deletions.
  1. +36 −39 application/src/main/java/org/mifos/framework/struts/ActionServlet30.java
@@ -27,50 +27,47 @@
import org.apache.struts.action.ActionServlet;
/**
- * Strut's 1.2.7's ActionServlet reads a WEB-INF/web.xml itself. In the new
- * Servlet 3.0-based workspace, this would fail (because it's in a
- * web-fragment.xml now) :
- *
- * <tt>ERROR org.apache.struts.action.ActionServlet The /WEB-INF/web.xml was not found.
- * ERROR, org.apache.struts.action.ActionServlet Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
- * javax.servlet.ServletException: The /WEB-INF/web.xml was not found.
- * at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1138)</tt>
- *
- * This ActionServlet subclass avoids reading WEB-INF/web.xml directly, and
- * obtains what ActionServlet wants from web.xml (just it's own URL mapping!)
- * differently; for the short-term (Jetty v7 with Servlet 2.6 API) it's just
- * hard-coded to "*.do", and when Jetty v8 is adopted and comes with the new
- * Servlet 3.0 API, the hard-coding can be removed and some commented out code
- * activated.)
- *
- * This class is declared in the web-fragment.xml (instead of the original ActionServlet),
- * as well as used hard-coded in the MifosMockStrutsTestCase (see there for details).
- *
- * @author Michael Vorburger
+ * Strut's 1.2.7's ActionServlet reads a WEB-INF/web.xml itself. In the new Servlet 3.0-based workspace, this would fail
+ * (because it's in a web-fragment.xml now) :
+ *
+ * <pre>ERROR org.apache.struts.action.ActionServlet The /WEB-INF/web.xml was not found.
+ * ERROR, org.apache.struts.action.ActionServlet Unable to initialize Struts ActionServlet due to an unexpected
+ * exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or
+ * missing library dependency.
+ * javax.servlet.ServletException: The /WEB-INF/web.xml was not found.
+ * at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1138)</pre>
+ * <p>
+ * This ActionServlet subclass avoids reading WEB-INF/web.xml directly, and obtains what ActionServlet wants from
+ * web.xml (just it's own URL mapping!) differently; for the short-term (Jetty v7 with Servlet 2.6 API) it's just
+ * hard-coded to "*.do", and when Jetty v8 is adopted and comes with the new Servlet 3.0 API, the hard-coding can be
+ * removed and some commented out code activated.)
+ * <p>
+ * This class is declared in the web-fragment.xml (instead of the original ActionServlet), as well as used hard-coded in
+ * the MifosMockStrutsTestCase (see there for details).
*/
public class ActionServlet30 extends ActionServlet {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- @Override
- protected void initServlet() throws ServletException {
- // DON'T super.initServlet();
+ @Override
+ protected void initServlet() throws ServletException {
+ // DON'T super.initServlet();
- // Remember our Servlet name, copy/pasted from super:
- this.servletName = getServletConfig().getServletName();
+ // Remember our Servlet name, copy/pasted from super:
+ this.servletName = getServletConfig().getServletName();
- // For now hard-coded...
- this.servletMapping = "*.do";
- // Later (on Jetty v8 with Servlet 8.0) remove hard-coding above and use this instead:
- // ServletRegistration mappings = getServletContext().getServletRegistration(servletName);
- // this.servletMapping = mappings.getMappings().iterator().next();
+ // For now hard-coded...
+ this.servletMapping = "*.do";
+ // Later (on Jetty v8 with Servlet 8.0) remove hard-coding above and use this instead:
+ // ServletRegistration mappings = getServletContext().getServletRegistration(servletName);
+ // this.servletMapping = mappings.getMappings().iterator().next();
- // copy/pasted from super:
- if (log.isDebugEnabled()) {
- log.debug("Mapping for servlet '" + servletName + "' = '" + servletMapping + "'");
- }
+ // copy/pasted from super:
+ if (log.isDebugEnabled()) {
+ log.debug("Mapping for servlet '" + servletName + "' = '" + servletMapping + "'");
+ }
- if (servletMapping != null) {
- getServletContext().setAttribute(Globals.SERVLET_KEY, servletMapping);
- }
- }
+ if (servletMapping != null) {
+ getServletContext().setAttribute(Globals.SERVLET_KEY, servletMapping);
+ }
+ }
}

0 comments on commit 6316743

Please sign in to comment.