Package com.caucho.server.dispatch

Examples of com.caucho.server.dispatch.ServletMapping


  @PostConstruct
  public void init()
    throws ServletException
  {
    if (_webApp != null) {
      ServletMapping mapping = _webApp.createServletMapping();
      mapping.setServletName("jsp-property-group-" + _gId++);
     
      if (Boolean.TRUE.equals(_isXml))
  mapping.setServletClass(JspXmlServlet.class.getName());
      else
  mapping.setServletClass(JspServlet.class.getName());

      for (int i = 0; i < _urlPatterns.size(); i++) {
  mapping.addURLPattern(_urlPatterns.get(i));
      }

      _webApp.addServletMapping(mapping);
    }
  }
View Full Code Here


  Class annType = ann.annotationType();
 
  if (annType.equals(WebServlet.class)) {
    WebServlet webServlet = (WebServlet) ann;
     
    ServletMapping mapping = new ServletMapping();

    for (String value : webServlet.value()) {
      mapping.addURLPattern(value);
    }
   
    for (String value : webServlet.urlPatterns()) {
      mapping.addURLPattern(value);
    }
   
    mapping.setBean(bean);
 
    mapping.init();

    _webApp.addServletMapping(mapping);

    event.veto();
  }
  else if (annType.isAnnotationPresent(ServiceType.class)) {
    ServiceType serviceType
      = (ServiceType) annType.getAnnotation(ServiceType.class);

    Class factoryClass = serviceType.defaultFactory();
    ProtocolServletFactory factory
      = (ProtocolServletFactory) factoryClass.newInstance();

    factory.setServiceType(ann);
    factory.setAnnotated(annotated);

    Method urlPatternMethod = annType.getMethod("urlPattern");

    String urlPattern = (String) urlPatternMethod.invoke(ann);
     
    ServletMapping mapping = new ServletMapping();
    mapping.addURLPattern(urlPattern);
    mapping.setBean(bean);

    mapping.setProtocolFactory(factory);
 
    mapping.init();

    _webApp.addServletMapping(mapping);

    // event.veto();
  }
View Full Code Here

    if (jsfPropertyGroup != null && jsfPropertyGroup.isEnableDeveloperAid()) {
      developerAidListener = new JsfDeveloperAid();

      //will use Servlet 3.0
      ServletMapping servletMapping = WebApp.getCurrent()
        .createServletMapping();

      servletMapping.addURLPattern("/caucho.jsf.developer.aid");
      servletMapping.setServletClass(JsfDeveloperAidServlet.class.getName());

      WebApp.getCurrent().addServletMapping(servletMapping);
    }

    Iterator iter = lifecycleFactory.getLifecycleIds();
View Full Code Here

    webAppConfig.setId(_serviceName);
    webAppConfig.setRootDirectory(new RawString("memory:/admin-dummy-root"));

    hostConfig.addBuilderProgram(new PropertyValueProgram("web-app", webAppConfig));

    ServletMapping servlet = new ServletMapping();

    servlet.setServletName(_serviceName);
    servlet.addURLPattern("/*");
    servlet.addURLRegexp(".*");
    servlet.setServletClass(ManagementServlet.class.getName());

    ContainerProgram servletInit = new ContainerProgram();
    servletInit.addProgram(new PropertyValueProgram("service", this));
    servlet.setInit(servletInit);

    webAppConfig.addBuilderProgram(new PropertyValueProgram("servlet-mapping", servlet));

    SecurityConstraint constraint = new SecurityConstraint();
    constraint.addURLPattern("/*");
 
View Full Code Here

TOP

Related Classes of com.caucho.server.dispatch.ServletMapping

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.