public void setServletContext(ServletContext servletContext) {
    if (servletContext == null) {
      throw new IllegalArgumentException("servletContext is null");
    }

    String contextPath = servletContext.getContextPath();
    if ((contextPath != null) && (contextPath.length() > 1)) {
      // use context path as jmx prefix
      prefix = contextPath.replaceFirst("/", "");
    } else {
      // use default jmx prefix
    }
  }
public void setServletContext ( ServletContext servletContext ) { if ( servletContext == null ) { throw new IllegalArgumentException ( "servletContext is null" ) ; } String contextPath = servletContext . getContextPath ( ) ; if ( ( contextPath != null ) && ( contextPath . length ( ) > 1 ) ) { prefix = contextPath . replaceFirst ( "/" , "" ) ; } else { } }
@see ServletContextAware#setServletContext(ServletContext)
@param servletContext the servlet context