Java

Guicing Struts 2

Look how deceptively easy the Guice User Manual makes adding Guice to a Struts 2 app appear. Look, it says, just add one jar and all your dependency injection needs will be meet. Of course what it fails to tell you is that in addition to adding the plugin JAR, you also need the base jar, the servlet jar and if you want it to work you need to download a fixed plugin jar. At one point it was moaning about commons-logging as well!

With all that done though, it does indeed work as advertised.

Standard

One thought on “Guicing Struts 2

  1. KingBoss says:

    Thanks, I too had this issue took me 1/2 hour of trying various things before I came across this post. guice-servlet-1.0.jar definatly required.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s