Need to get deflate,gzip content encoding working in my servlet programmatically

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Need to get deflate,gzip content encoding working in my servlet programmatically

Clive Haworth
Hi.

I currently have a simple servlet such:

.. create server object and listener.

// Create a resource handler.
ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setDirAllowed(false);

// Create a servlet handler.
ServletHandler servletHandler = new ServletHandler();
servletHandler.addServlet("test", "/test", "com.me.Test");

// Create a context.
HttpContext context = new HttpContext();
context.setContextPath("/");
context.setResourceBase((String) Config.get("DOCUMENT_ROOT"));
context.addHandler(resourceHandler);
context.addHandler(servletHandler);

// Start the Web server.
server.addContext(context);
server.start();

As you can see I have two handlers in my context, one to handle static & one a
servlet. I need something to check the "Accept-Encoding" request header and
automatically deflate if it's there. Do I need to write this myself or is there
some neat way I'm missing ?

Also can I configure re-directs programatically too ?

Cheers,
Clive



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support