Package org.mortbay.jetty.webapp

Examples of org.mortbay.jetty.webapp.WebXmlConfiguration


        server = new Server();

        explodedWarDir = WarExploder.getExplodedDir();
        WebAppContext context = new WebAppContext(explodedWarDir.getPath(), contextPath);
        context.setClassLoader(getClass().getClassLoader());
        context.setConfigurations(new Configuration[]{new WebXmlConfiguration(), new NoListenerConfiguration()});
        server.setHandler(context);
        context.setMimeTypes(MIME_TYPES);
        if(Functions.isWindows()) {
            // this is only needed on Windows because of the file
            // locking issue as described in JENKINS-12647
View Full Code Here


    String webXmlUrlString = webXmlUrl.toExternalForm();
    String oldProp = System.getProperty("org.mortbay.xml.XmlParser.Validating",
        "false");
    try {
      System.setProperty("org.mortbay.xml.XmlParser.Validating", "false");
      WebXmlConfiguration wxc = new WebXmlConfiguration();
      ServletHandler myServletHandler = new ServletHandler();
      wxc.setWebAppContext(new WebAppContext(null, null, myServletHandler, null));
      wxc.configure(webXmlUrlString);
      ServletMapping[] mappings = myServletHandler.getServletMappings();
      ServletHolder[] servlets = myServletHandler.getServlets();
      Map<String, String> servletNameToClassName = new HashMap<String, String>();
      Map<String, Set<String>> classNameToPaths = new HashMap<String, Set<String>>();
      Map<String, String> classNameToServletName = new HashMap<String, String>();
View Full Code Here

    protected ServletContext createWebServer() throws Exception {
        server = new Server();

        WebAppContext context = new WebAppContext(WarExploder.getExplodedDir().getPath(), contextPath);
        context.setClassLoader(getClass().getClassLoader());
        context.setConfigurations(new Configuration[]{new WebXmlConfiguration(), new NoListenerConfiguration()});
        server.setHandler(context);
        context.setMimeTypes(MIME_TYPES);

        SocketConnector connector = new SocketConnector();
        connector.setHeaderBufferSize(12*1024); // use a bigger buffer as Stapler traces can get pretty large on deeply nested URL
View Full Code Here

    String webXmlUrlString = webXmlUrl.toExternalForm();
    String oldProp = System.getProperty("org.mortbay.xml.XmlParser.Validating",
        "false");
    try {
      System.setProperty("org.mortbay.xml.XmlParser.Validating", "false");
      WebXmlConfiguration wxc = new WebXmlConfiguration();
      ServletHandler myServletHandler = new ServletHandler();
      wxc.setWebAppContext(new WebAppContext(null, null, myServletHandler, null));
      wxc.configure(webXmlUrlString);
      ServletMapping[] mappings = myServletHandler.getServletMappings();
      ServletHolder[] servlets = myServletHandler.getServlets();
      Map<String, String> servletNameToClassName = new HashMap<String, String>();
      Map<String, Set<String>> classNameToPaths = new HashMap<String, Set<String>>();
      Map<String, String> classNameToServletName = new HashMap<String, String>();
View Full Code Here

            This code assumes far too much internal knowledge of Jetty. I don't know
            of simple way to parse the web.xml though and don't want to write it myself.
         */

        final URL url = new URL("file", null, securityFile);
        final WebXmlConfiguration webXmlConfiguration = new WebXmlConfiguration();
        WebAppContext context = new WebAppContext();
        context.setServer(server);
        webXmlConfiguration.setWebAppContext(context);
        ContextHandler contextHandler = new ContextHandler("/")
        {
            @Override
            protected void startContext() throws Exception
            {
                super.startContext();
                setServer(server);
                webXmlConfiguration.configure(url.toString());
            }
        };
        contextHandler.start();
        try
        {
            SecurityHandler securityHandler = webXmlConfiguration.getWebAppContext().getSecurityHandler();

            if ( realm != null )
            {
                securityHandler.setUserRealm(realm);
            }
View Full Code Here

    protected ServletContext createWebServer() throws Exception {
        server = new Server();

        WebAppContext context = new WebAppContext(WarExploder.getExplodedDir().getPath(), contextPath);
        context.setClassLoader(getClass().getClassLoader());
        context.setConfigurations(new Configuration[]{new WebXmlConfiguration(),new NoListenerConfiguration()});
        server.setHandler(context);
        context.setMimeTypes(MIME_TYPES);

        SocketConnector connector = new SocketConnector();
        server.addConnector(connector);
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.webapp.WebXmlConfiguration

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.