Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
2.1.10
-
None
-
Normal
-
Cocoon Core
-
Cocoon Core
Description
The error message in the last line of the code below misnames the parameter as 'configuration' instead of 'configurations'.
The easy fix is to add an 's'.
A better fix would move the string to a constant for use in all the code below
[Obviously excerpted code. Pretend ellipses are after each line.]
public class CocoonServlet extends HttpServlet {
public void init(ServletConfig conf) throws ServletException {
this.appContext.put(Constants.CONTEXT_CONFIG_URL, getConfigFile(conf.getInitParameter("configurations")));
}
private URL getConfigFile(final String configFileName) throws ServletException {
getLogger().warn("Servlet initialization argument 'configurations' not specified, attempting to use '/WEB-INF/cocoon.xconf'");
getLogger().debug("Using configuration file: " + usedFileName);
String msg = "Init parameter 'configurations' is invalid : " + usedFileName;
String msg = "Init parameter 'configurations' is invalid : " + usedFileName;
String msg = "Init parameter 'configuration' doesn't name an existing resource : " + usedFileName;
}
}
The easy fix is to add an 's'.
A better fix would move the string to a constant for use in all the code below
[Obviously excerpted code. Pretend ellipses are after each line.]
public class CocoonServlet extends HttpServlet {
public void init(ServletConfig conf) throws ServletException {
this.appContext.put(Constants.CONTEXT_CONFIG_URL, getConfigFile(conf.getInitParameter("configurations")));
}
private URL getConfigFile(final String configFileName) throws ServletException {
getLogger().warn("Servlet initialization argument 'configurations' not specified, attempting to use '/WEB-INF/cocoon.xconf'");
getLogger().debug("Using configuration file: " + usedFileName);
String msg = "Init parameter 'configurations' is invalid : " + usedFileName;
String msg = "Init parameter 'configurations' is invalid : " + usedFileName;
String msg = "Init parameter 'configuration' doesn't name an existing resource : " + usedFileName;
}
}