Sunday, February 8, 2009

Struts 2 jar files

This blog post intends to answer the following questions :-
  1. What are the 'jar' files that are required to run my Struts 2 application?
  2. Where do I keep the jar files required by Struts 2 in my web application?
  3. From where do i get the jar files required by Struts 2?
Well, a Struts 2 application is no different from a normal web-application and requires no 'special' container like JBoss or Glassfish to execute. Even our dear friend - Tomcat will suffice. The reason is the fact that Struts 2 is a simple framework that is based upon the MVC architecture(MVC-2, to be precise) and all that is required of you is to copy a few jar files to your web application. As I have already mentioned about how a simple web application is structured here, i am only going to mention the names of the files that will be required by you to run your application.

The following jar files will be required :-
  1. commons-logging-x.x.jar
  2. freemarker-x.x.jar
  3. xwork-x.x.jar
  4. struts2-core-x.x.jar
  5. ognl-x.x.jar
On my system, I use the following jar files for Struts 2:-
  1. commons-logging-1.1.jar
  2. freemarker-2.3.8.jar
  3. xwork-2.0.1.jar
  4. struts2-core-2.0.6.jar
  5. ognl-2.6.11.jar
Now, where do we place these files? Of course, since all of them are jar files, like all other good web applications, even they have to be placed in the 'lib' directory in your web application.

From where to get these jar files? Our brethren at Apache have it all sorted out. Just click here and ye shall get all that ye might ever ask for!

Happy Programming ;)

Signing Off

No comments: