Package org.mortbay.jetty.servlet

Examples of org.mortbay.jetty.servlet.ServletHolder


    protected void createContext( Server server, File repositoryDirectory )
        throws IOException
    {
        Context root = new Context( server, "/", Context.SESSIONS );
        root.setResourceBase( repositoryDirectory.getAbsolutePath() );
        ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
        root.addServlet( servletHolder, "/*" );
    }
View Full Code Here


        Server server = new Server( getTestRepositoryPort() );

        String localRepositoryPath = FileTestUtils.getTestOutputDir().toString();
        Context root = new Context( server, "/", Context.SESSIONS );
        root.setResourceBase( localRepositoryPath );
        ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
        servletHolder.setInitParameter( "gzip", "true" );
        root.addServlet( servletHolder, "/*" );
        addConnectors( server );
        server.start();

        try
View Full Code Here

        Context root = new Context( Context.SESSIONS );
        root.setContextPath( "/" );
        root.addHandler( sh );
        root.setResourceBase( localRepositoryPath );
        ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
        root.addServlet( servletHolder, "/*" );

        server.setHandler( root );
        addConnectors( server );
        return server;
View Full Code Here

        server = new Server( 0 );

        Context root = new Context( server, "/", Context.SESSIONS );
        root.setResourceBase( new File( getBasedir(), "/target" ).getAbsolutePath() );
        ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
        root.addServlet( servletHolder, "/*" );

        server.start();

        try
View Full Code Here

        server = new Server( 0 );

        Context root = new Context( server, "/", Context.SESSIONS );
        root.setResourceBase( new File( getBasedir(), "/target" ).getAbsolutePath() );
        ServletHolder servletHolder = new ServletHolder( new HttpServlet()
        {
            @Override
            protected void doGet( HttpServletRequest req, HttpServletResponse resp )
                throws ServletException, IOException
            {
View Full Code Here

  public static final String BODY_PARAM = "body";
  public static final String HEADER_PARAM = "header";

  @Override
  protected void addServlets() throws Exception {
    ServletHolder servletHolder = new ServletHolder(new EchoServlet());
    context.addServlet(servletHolder, "/*");
  }
View Full Code Here

    @Test
    public void testSendAndReceiveFault() throws Exception {
        MyServlet servlet = new MyServlet();
        servlet.setResponseStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        servlet.setResponse(true);
        jettyContext.addServlet(new ServletHolder(servlet), "/");
        jettyServer.start();
        FaultAwareWebServiceConnection connection =
                (FaultAwareWebServiceConnection) messageSender.createConnection(connectionUri);
        SOAPMessage request = createRequest();
        try {
View Full Code Here

            connection.close();
        }
    }

    private void validateResponse(Servlet servlet) throws Exception {
        jettyContext.addServlet(new ServletHolder(servlet), "/");
        jettyServer.start();
        FaultAwareWebServiceConnection connection =
                (FaultAwareWebServiceConnection) messageSender.createConnection(connectionUri);
        SOAPMessage request = createRequest();
        try {
View Full Code Here

            connection.close();
        }
    }

    private void validateNonResponse(Servlet servlet) throws Exception {
        jettyContext.addServlet(new ServletHolder(servlet), "/");
        jettyServer.start();

        WebServiceConnection connection = messageSender.createConnection(connectionUri);
        SOAPMessage request = createRequest();
        try {
View Full Code Here

    public void testContextClose() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance();
        int port = FreePortScanner.getFreePort();
        Server jettyServer = new Server(port);
        Context jettyContext = new Context(jettyServer, "/");
        jettyContext.addServlet(new ServletHolder(new EchoServlet()), "/");
        jettyServer.start();
        WebServiceConnection connection = null;
        try {

            StaticApplicationContext appContext = new StaticApplicationContext();
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.servlet.ServletHolder

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.