Set up a J2EE Web Application Project That Uses Struts Frameworks

J2EE Web Application Project is dynamic web project. It is combination of Java, Servelet, JSP and Static Web Recourses(like html, css, images, etc ). In J2EE only one xml is required.
That is deployment descriptor file (e.g. web.xml).This deployment descriptor file is used to define all configuration of the J2EE web based application like welcome file,
securities, tag lib ,Servelet configurations and Servelet mapping etc.


In struts only on more extra file is required that is struts-config.xml. Which is used to configure the Actions, ActionForms, add plug-in etc. Here in Struts application we have configured and mapping ActionServet into web.xml .The ActionServet works as controller in Struts based application. We also need some Jars which we can download from http://struts.apache.org/download.cgi#struts1310 Extract it and copy it and past it into lib folder of your J2EE web application project. So we can say we have following steps to set up a J2EE web application project into struts 1. Add struts frameworks jars into lib folder. 2. Create a struts-config.xml file. 3. Configure ActionServelet and add ActionServelet mapping into web.xml and add struts-config.xml into web.xml 4. Create Subclasses ActionForm to gather the data of input JSPs and make Actions class which is called by ActionServelet and call appropriate models and finally returns a key. This key is used by ActionServelet to decide next view to user.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More