Tuesday, December 22, 2009

Struts 2 environement setup

Here is a sample web.xml to add struts functionality to a web application. The most important part is the struts filter.

Remember to include the following jar files in the classpath to use struts 2 fuctionality. i.e. lib directory.

commons-logging-1.0.4.jar
freemarker-2.3.8.jar
ognl-2.6.11.jar
struts2-core-2.0.14.jar
xwork-2.0.7.jar

As is visible from the name of the struts jar file, these are the jar files that are required for struts 2. The dependencies of the jar files may change depending upon the version of struts you use. For now, these versions are compatible with each other.



    
        
            30
        
    
    
        struts2
        org.apache.struts2.dispatcher.FilterDispatcher
    
    
        struts2
        /*
    
    
        index.jsp
    




This should be enough to set up the environment for Struts 2. Additional functionality can be provided to struts 2 by adding more jar files, but i am not concerned with that in this post. As of now, i just want to be able to have the bare minimum environmental settings for creating a struts 2 application, and this resolves my problem.

Signing Off
Ryan Sukale

No comments: