/** * Returns the value of a given initialization parameter, first from the * Servlet configuration, then from the Web Application context. * * @param name * The parameter name. * @param defaultValue * The default to use in case the parameter is not found. * @return The value of the parameter or null. */ public String getInitParameter(String name, String defaultValue) { String result = getServletConfig().getInitParameter(name); if (result == null) { result = getServletConfig().getServletContext().getInitParameter( name); } if (result == null) { result = defaultValue; } return result; }
final javax.servlet.ServletConfig servletConfig = getServletConfig(); for (final Enumeration<String> enum1 = servletConfig .getInitParameterNames(); enum1.hasMoreElements();) {
Client client = createWarClient(new Context(), getServletConfig()); Response response = client.get("war:///WEB-INF/restlet.xml"); if (response.getStatus().isSuccess() && response.isEntityAvailable()) { createWarClient(component.getContext(), getServletConfig())); final javax.servlet.ServletConfig servletConfig = getServletConfig(); for (final Enumeration<String> enum1 = servletConfig .getInitParameterNames(); enum1.hasMoreElements();) {
/** * Indicates if the Component hosted by this Servlet is the default one or * one provided by the user. * * @return True if the Component is the default one, false otherwise. */ private boolean isDefaultComponent() { // The Component is provided via an XML configuration file. Client client = createWarClient(new Context(), getServletConfig()); Response response = client.get("war:///WEB-INF/restlet.xml"); if (response.getStatus().isSuccess() && response.isEntityAvailable()) { return false; } // The Component is provided via a context parameter in the "web.xml" // file. final String componentAttributeName = getInitParameter(COMPONENT_KEY, null); if (componentAttributeName != null) { return false; } return true; }