Package javax.servlet.annotation

Examples of javax.servlet.annotation.WebServlet.urlPatterns()


    String[] patterns = null;

    if (isServlet) {
      WebServlet servlet = getClass().getAnnotation(WebServlet.class);
      if (servlet != null) {
        if (servlet.urlPatterns().length > 0) {
          patterns = servlet.urlPatterns();
        } else {
          patterns = servlet.value();
        }
      }
View Full Code Here


    if (isServlet) {
      WebServlet servlet = getClass().getAnnotation(WebServlet.class);
      if (servlet != null) {
        if (servlet.urlPatterns().length > 0) {
          patterns = servlet.urlPatterns();
        } else {
          patterns = servlet.value();
        }
      }
    } else {
View Full Code Here

                    String classname = nameFromUrls(url, servletPath);

                    final Class<?> clazz = webContext.getClassLoader().loadClass(classname);
                    final WebServlet annotation = clazz.getAnnotation(WebServlet.class);
                    if (annotation != null) {
                        for (String mapping: annotation.urlPatterns()) {
                            try {
                                addServletMethod.invoke(null, classname, webContext, mapping);
                                deployedWebObjects.mappings.add(mapping);
                            } catch (Exception e) {
                                LOGGER.warning(e.getMessage(), e);
View Full Code Here

    for (String value : webServlet.value()) {
      mapping.addURLPattern(value);
    }
   
    for (String value : webServlet.urlPatterns()) {
      mapping.addURLPattern(value);
    }
   
    mapping.setBean(bean);
 
View Full Code Here

        }
        webCompDesc.setServlet(true);
        webCompDesc.setWebComponentImplementation(webCompClass.getName());

        if (webCompDesc.getUrlPatternsSet().size() == 0) {
            String[] urlPatterns = webServletAn.urlPatterns();
            if (urlPatterns == null || urlPatterns.length == 0) {
                urlPatterns = webServletAn.value();
            }

            // no url patterns is accepted as it may be defined in top level xml
View Full Code Here

                    String classname = nameFromUrls(url, servletPath);

                    final Class<?> clazz = webContext.getClassLoader().loadClass(classname);
                    final WebServlet annotation = clazz.getAnnotation(WebServlet.class);
                    if (annotation != null) {
                        for (String mapping: annotation.urlPatterns()) {
                            try {
                                addServletMethod.invoke(null, classname, webContext, mapping);
                                deployedWebObjects.mappings.add(mapping);
                            } catch (Exception e) {
                                LOGGER.warning(e.getMessage(), e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.