use of jmri.web.servlet.DenialServlet in project JMRI by JMRI.
the class WebServer method registerDenial.
/**
* Register a URL pattern to be denied access.
*
* @param urlPattern the pattern to deny access to
*/
public void registerDenial(String urlPattern) {
this.registeredUrls.put(urlPattern, Registration.DENIAL);
ServletContextHandler servletContext = new ServletContextHandler(ServletContextHandler.NO_SECURITY);
servletContext.setContextPath(urlPattern);
DenialServlet servlet = new DenialServlet();
// NOI18N
servletContext.addServlet(new ServletHolder(servlet), "/*");
((ContextHandlerCollection) this.server.getHandler()).addHandler(servletContext);
}
Aggregations