Chapter 5. Integrating Guice with Struts 2

This chapter demonstrates integration of Guice 3 with Struts 2. It is an action oriented, web framework based on MVC architecture. Guice integrates easily to provide dependency injection facility into the application developed. We will discuss the special modules and classes, which accomplish the task of integration. On top of it we would retrofit our application developed in the last chapter to be based on Struts 2. While doing so we will avoid writing servlets and filters and instead use Struts 2 provided classes.

It is desired that the reader is familiar with Struts 2, as primarily we are interested in injecting dependencies in Struts 2-based applications and not exploring Struts 2 itself. However, ...

Get Learning Google Guice now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.