Warp :: Servlet

 Enhanced Web and Servlet functionality in your Guice applications!

Warp-servlet is currently beta and licensed under Apache 2.0.

[   Warp    Source    Download    Troubleshooting    Email   ]

Wideplay's enhanced Servlet support for Guice

Warp-servlet is intended to be a complete drop-in replacement for the guice-servlet module. There are many reasons to prefer warp-servlet to guice's servlet support, and they are detailed below. Of course, like all Warp Framework modules, warp-servlet does not have any dependency on Warp, or on Guice's servlet support and can be used together with or independently from all other Warp modules, and in any Guice web application. 

Follow these guides to get up and running quickly with warp-servlet:

Why warp-servlet and not guice-servlet?

Warp-servlet provides a superset of guice-servlet's features. Which means, it does everything guice-servlet does and a whole lot more:

  • Filters and Servlets can be managed by your Guice injector when you use warp-servlet. This means your Servlets and Filters benefit from:
    1. Constructor injection
    2. AOP interception (use warp-persist for transactional servlets!)
    3. Cyclical dependency injection
    4. Scope (yes, you can declare scope on Filters and Servlets)

These are not supported by the standard guice-servlet integration or InjectedHttpServlet

  • Conversely, this also means that your Guice-managed objects can hook into the Servlet lifecycle (init/destroy, etc.). This is cool because in addition to your any of your own services, it gives you a place to bootstrap and shutdown your warp-persist driven persistence layer.
  • Filters and Servlets managed by warp-servlet can map to URIs using regular expressions.
  • As you might expect, warp-servlet provides Request and Session scope out of the box, and an additional Flash scope; with a planned conversation scope coming soon. 
  • Because warp-servlet is applied as a filter, it works comfortably with the Servlet container pipeline so you don't have to touch your existing web.xml servlets and filters (or, you can migrate them at your own pace one by one).
  • Warp-servlet gives you many more features and safer behavior (for example: constructor injection) than guice-servlet

Warp-servlet is not a web or MVC framework. It simply provides some mitigation tools and architectural niceties for your webapps (like warp-persist does for Hibernate and transactions). You can have your plain JSP, Apache Wicket or Struts2 webapps (really any webapp) benefit from warp-servlet with minimal effort.

Contribute to the Warp Framework

Get involved! Email me on the Warp mailing list if you want to help or have a problem to report. Problems with Guice should be reported on the Guice user mailing list.