private List<ContainerInitializer> jspInitializers() { JettyJasperInitializer sci = new JettyJasperInitializer(); ContainerInitializer initializer = new ContainerInitializer( (ServletContainerInitializer) sci, null); List<ContainerInitializer> initializers = new ArrayList<ContainerInitializer>(); initializers.add(initializer); return initializers; }
@Override public boolean equals(Object o) { if (super.equals(o) && (o instanceof PreDestroyCallback)) return true; return false; } }
public void handleMethod(String className, String methodName, int access, String params, String signature, String[] exceptions, String annotation, List<Value> values) { _initializer.addAnnotatedTypeName(className); }
public void callback (Object instance) throws SecurityException, IllegalArgumentException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException, InvocationTargetException { super.callback(instance); }
/** * Creates a Jetty context handler that can be used to expose the cross-domain functionality as implemented by * {@link FlashCrossDomainServlet}. * * Note that an invocation of this method will not register the handler (and thus make the related functionality * available to the end user). Instead, the created handler is returned by this method, and will need to be * registered with the embedded Jetty webserver by the caller. * * @return A Jetty context handler (never null). */ protected Handler createCrossDomainHandler() { final ServletContextHandler context = new ServletContextHandler( null, "/crossdomain.xml", ServletContextHandler.SESSIONS ); // Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs). final List<ContainerInitializer> initializers = new ArrayList<>(); initializers.add( new ContainerInitializer( new JasperInitializer(), null ) ); context.setAttribute( "org.eclipse.jetty.containerInitializers", initializers ); context.setAttribute( InstanceManager.class.getName(), new SimpleInstanceManager() ); // Generic configuration of the context. context.setAllowNullPathInfo( true ); // Add the functionality-providers. context.addServlet( new ServletHolder( new FlashCrossDomainServlet() ), "" ); return context; }
public boolean equals (Object o) { if (super.equals(o) && (o instanceof PostConstructCallback)) return true; return false; } }
/** * Handle finding a class that is annotated with the annotation we were constructed with. * @see org.eclipse.jetty.annotations.AnnotationParser.DiscoverableAnnotationHandler#handleClass(java.lang.String, int, int, java.lang.String, java.lang.String, java.lang.String[], java.lang.String, java.util.List) */ public void handleClass(String className, int version, int access, String signature, String superName, String[] interfaces, String annotationName, List<Value> values) { _initializer.addAnnotatedTypeName(className); }
public void callback (Object instance) throws SecurityException, IllegalArgumentException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException, InvocationTargetException { super.callback(instance); }
private void createWebAppContext() { contexts = new ContextHandlerCollection(); WebAppContext context; // Add web-app. Check to see if we're in development mode. If so, we don't // add the normal web-app location, but the web-app in the project directory. boolean developmentMode = Boolean.getBoolean("developmentMode"); if( developmentMode ) { System.out.println(LocaleUtils.getLocalizedString("admin.console.devmode")); context = new WebAppContext(contexts, pluginDir.getParentFile().getParentFile().getParentFile().getParent() + File.separator + "src" + File.separator + "web", "/"); } else { context = new WebAppContext(contexts, pluginDir.getAbsoluteFile() + File.separator + "webapp", "/"); } // Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs). final List<ContainerInitializer> initializers = new ArrayList<>(); initializers.add(new ContainerInitializer(new JasperInitializer(), null)); context.setAttribute("org.eclipse.jetty.containerInitializers", initializers); context.setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager()); // The index.html includes a redirect to the index.jsp and doesn't bypass // the context security when in development mode context.setWelcomeFiles(new String[]{"index.html"}); // Make sure the context initialization is done when in development mode if( developmentMode ) { context.addBean( new ServletContainerInitializersStarter( context ), true ); } }
public boolean equals(Object o) { if (super.equals(o) && (o instanceof PreDestroyCallback)) return true; return false; } }
public void handleField(String className, String fieldName, int access, String fieldType, String signature, Object value, String annotation, List<Value> values) { _initializer.addAnnotatedTypeName(className); }
initializers.add( new ContainerInitializer( new JasperInitializer(), null ) ); context.setAttribute( "org.eclipse.jetty.containerInitializers", initializers ); context.setAttribute( InstanceManager.class.getName(), new SimpleInstanceManager() );
@Override public boolean equals (Object o) { if (super.equals(o) && (o instanceof PostConstructCallback)) return true; return false; } }
/** * Handle finding a class that is annotated with the annotation we were constructed with. * @see org.eclipse.jetty.annotations.AnnotationParser.DiscoverableAnnotationHandler#handleClass(java.lang.String, int, int, java.lang.String, java.lang.String, java.lang.String[], java.lang.String, java.util.List) */ public void handleClass(String className, int version, int access, String signature, String superName, String[] interfaces, String annotationName, List<Value> values) { _initializer.addAnnotatedTypeName(className); }
static WebAppContext newWebAppContext() throws MalformedURLException { final WebAppContext handler = new WebAppContext(); handler.setContextPath("/"); handler.setBaseResource(Resource.newResource(webAppRoot())); handler.setClassLoader(new URLClassLoader( new URL[] { Resource.newResource(new File(webAppRoot(), "WEB-INF" + File.separatorChar + "lib" + File.separatorChar + "hello.jar")).getURI().toURL() }, JettyService.class.getClassLoader())); handler.addBean(new ServletContainerInitializersStarter(handler), true); handler.setAttribute( "org.eclipse.jetty.containerInitializers", Collections.singletonList(new ContainerInitializer(new JettyJasperInitializer(), null))); return handler; }
public boolean equals (Object o) { if (super.equals(o) && (o instanceof PostConstructCallback)) return true; return false; } }
public void handleField(String className, String fieldName, int access, String fieldType, String signature, Object value, String annotation, List<Value> values) { _initializer.addAnnotatedTypeName(className); }
public boolean equals(Object o) { if (super.equals(o) && (o instanceof PreDestroyCallback)) return true; return false; } }
public void handleMethod(String className, String methodName, int access, String params, String signature, String[] exceptions, String annotation, List<Value> values) { _initializer.addAnnotatedTypeName(className); }
public void handleField(String className, String fieldName, int access, String fieldType, String signature, Object value, String annotation, List<Value> values) { _initializer.addAnnotatedTypeName(className); }