Package javax.ws.rs

Examples of javax.ws.rs.ApplicationPath


        }
       
        JAXRSServerFactoryBean bean = new JAXRSServerFactoryBean();
        String address = "/";
        if (!ignoreAppPath) {
            ApplicationPath appPath = app.getClass().getAnnotation(ApplicationPath.class);
            if (appPath != null) {
                address = appPath.value();
            }
        }
        if (!address.startsWith("/")) {
            address = "/" + address;
        }
View Full Code Here


        }
       
        JAXRSServerFactoryBean bean = new JAXRSServerFactoryBean();
        String address = "/";
        if (!ignoreAppPath) {
            ApplicationPath appPath = app.getClass().getAnnotation(ApplicationPath.class);
            if (appPath != null) {
                address = appPath.value();
            }
        }
        if (!address.startsWith("/")) {
            address = "/" + address;
        }
View Full Code Here

        }
       
        JAXRSServerFactoryBean bean = new JAXRSServerFactoryBean();
        String address = "/";
        if (!ignoreAppPath) {
            ApplicationPath appPath = app.getClass().getAnnotation(ApplicationPath.class);
            if (appPath != null) {
                address = appPath.value().length() == 0 ? "/" : appPath.value();
            }
        }
        bean.setAddress(address);
        bean.setResourceClasses(resourceClasses);
        bean.setProviders(providers);
View Full Code Here

        }
       
        JAXRSServerFactoryBean bean = new JAXRSServerFactoryBean();
        String address = "/";
        if (!ignoreAppPath) {
            ApplicationPath appPath = app.getClass().getAnnotation(ApplicationPath.class);
            if (appPath != null) {
                address = appPath.value().length() == 0 ? "/" : appPath.value();
            }
        }
        bean.setAddress(address);
        bean.setResourceClasses(resourceClasses);
        bean.setProviders(providers);
View Full Code Here

                    appInstance = Application.class.cast(appClazz.newInstance());
                } catch (Exception e) {
                    throw new OpenEJBRestRuntimeException("can't create class " + app, e);
                }

                ApplicationPath path = appClazz.getAnnotation(ApplicationPath.class);
                if (path != null) {
                    String appPath = path.value();
                    if (appPath.startsWith("/")) {
                        appPrefix += appPath.substring(1);
                    } else {
                        appPrefix += appPath;
                    }
View Full Code Here

        }
    }
   
    private void addServletWithApplication(ServletContext sc,
            Class<? extends Application> a, Set<Class<?>> classes) {
        final ApplicationPath ap = a.getAnnotation(ApplicationPath.class);
        if (ap != null) {
            // App is annotated with ApplicationPath
           
            final ServletContainer s = new ServletContainer(
                    new DeferredResourceConfig(a, getRootResourceAndProviderClasses(classes)));
View Full Code Here

            rc.setPropertiesAndFeatures(initParams);

            final ServletContainer s = new ServletContainer(rc);
            sr = sc.addServlet(a.getName(), s);
            if (sr.getMappings().isEmpty()) {
                final ApplicationPath ap = a.getAnnotation(ApplicationPath.class);
                if (ap != null) {
                    final String mapping = createMappingPath(ap);
                    if (!mappingExists(sc, mapping)) {
                        sr.addMapping(mapping);
View Full Code Here

    /**
     * Add new servlet according {@link Application} subclass with {@link ApplicationPath} annotation.
     */
    private static void addServletWithApplication(final ServletContext sc, final Class<? extends Application> a,
                                                  final Set<Class<?>> classes) throws ServletException {
        final ApplicationPath ap = a.getAnnotation(ApplicationPath.class);
        if (ap != null) {
            // App is annotated with ApplicationPath
            final ResourceConfig resourceConfig = ResourceConfig.forApplicationClass(a, classes);
            final ServletContainer s = new ServletContainer(resourceConfig);
            final ServletRegistration.Dynamic dsr = sc.addServlet(a.getName(), s);
View Full Code Here

            final ServletRegistration.Dynamic dsr = sc.addServlet(a.getName(), s);
            dsr.setAsyncSupported(true);
            dsr.setLoadOnStartup(1);

            if (dsr.getMappings().isEmpty()) {
                final ApplicationPath ap = a.getAnnotation(ApplicationPath.class);
                if (ap != null) {
                    final String mapping = createMappingPath(ap);
                    if (!mappingExists(sc, mapping)) {
                        dsr.addMapping(mapping);
View Full Code Here

                break;
            }
        }

        // annotation
        final ApplicationPath path = appClazz.getAnnotation(ApplicationPath.class);
        if (path != null) {
            final String appPath = path.value();

            if (builder == null) {
                builder = new StringBuilder();
            } else if (builder.length() > 0 && builder.charAt(builder.length() - 1) != '/') {
                builder.append('/');
View Full Code Here

TOP

Related Classes of javax.ws.rs.ApplicationPath

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.