Package org.apache.tomcat.lite.proxy

Examples of org.apache.tomcat.lite.proxy.StaticContentService


    }

    public static BaseMapper.Context initTestContext(Dispatcher d) throws IOException {
        BaseMapper.Context mCtx = d.addContext(null, "", null, null, null, null);

        mCtx.addWrapper("/", new StaticContentService()
            .setContentType("text/html")
            .setData("<a href='/proc/cpool/client'>Client pool</a><br>" +
                    "<a href='/proc/cpool/server'>Server pool</a><br>" +
                    "<a href='/proc/cpool/proxy'>Proxy pool</a><br>" +
                    ""));

        mCtx.addWrapper("/favicon.ico",
                new StaticContentService().setStatus(404).setData("Not found"));

        mCtx.addWrapper("/hello", new StaticContentService().setData("Hello world"));
        mCtx.addWrapper("/2nd", new StaticContentService().setData("Hello world2"));
        mCtx.addWrapper("/echo/*", new EchoCallback());

        mCtx.addWrapper("/sleep/1", new SleepCallback().setData("sleep 1"));
        mCtx.addWrapper("/sleep/10", new SleepCallback().sleep(10000).setData(
                "sleep 1"));

        mCtx.addWrapper("/chunked/*", new StaticContentService().setData("AAAA")
                .chunked());
        mCtx.addWrapper("/helloClose", new HttpService() {
            @Override
            public void service(HttpRequest httpReq, HttpResponse httpRes)
                    throws IOException {
View Full Code Here

TOP

Related Classes of org.apache.tomcat.lite.proxy.StaticContentService

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.