Вы находитесь на странице: 1из 2

Struts 2 An Introduction Apache Struts 2 is one of the most most popular enterprise-ready Java web applic ation framework.

Is designed to streamline the complete development cycle, from building, to deploying and maintaining an application over time. Originally known as WebWork 2. Struts2 was created after the merger of the WebWo rk and Struts communities. <strong>Build! Deploy! Maintain! </strong> <strong>Build! </strong> Easy startup - Jumpstart new projects with our bootstrap tutorial and template a pplication or Maven archetype. Improved Design - Code clean against HTTP-independant framework interfaces. Enhanced Tags - Code less with stylesheet-driven form tags that provide their ow n markup. Stateful Checkboxes - Avoid special handling with smart checkboxes that know whe n they are toggled. Flexible Cancel Buttons - Go directly to a different action on cancel. First-class AJAX support - Add interactivity and flexibility with AJAX tags that look and feel just like standard Struts tags. Easy Spring integration - Inject dependencies into Actions using Spring without glue code or red tape. (Plexus support also available.) Enhanced Results - Do more with speciality results for JasperReports, JFreeChart , Action chaining, and file downloading. POJO forms - No more ActionForms! Use any JavaBean to capture form input or put properties directly on an Action class. Use both binary and String properties! POJO Actions - Use any class as an Action class -- even the interface is optiona l! Deploy! Easy plugins - Add framework extensions by dropping in a JAR. No manual configur ation required! Bundled plugins add support for JavaServer Faces, JasperReports, JFreeChart, Tiles, and more ... Integrated profiling - Peek inside Struts2 to find where the cycles are going! Precise Error Reporting - Flip directly to the location and line of an error. Maintain! Easy-to-test Actions - Test Struts2 Actions directly, without resorting to mock HTTP objects. Intelligent Defaults - Skip obvious and redundant settings. Most framework confi guration elements have a default value that we can set and forget. Say it once! Easy-to-customize controller - Customize the request handling per action, if des ired. Struts2 only does what you want it to do! Integrating Debugging - Research problem reports with built-in debugging tools. Easy-to-tweak tags - Customize tag markup by editing a FreeMarker template. No n eed to grok the taglib API! JSP, FreeMarker, and Velocity tags are fully support ed. ################################################################################ ###################### When talking about struts 'Action' is the feature which you come across the most . Action is the core functionality where other features are build arount it. Steps for setting up a struts2 (struts 2.3.15 ) project. 1. Create a Dynamic Web Project in Eclipse. 2. Register the struts2 filter in web.xml <code> <filter>

<filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecut eFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </code> 3. Add the Libraries in the WebContent-&gt;WEB-INF-&gt;lib folder. asm-x.x.jar asm-commons-x.x.jar asm-tree-x.x.jar commons-io-X.X.X.jar commons-lang3-X.X.X.jar commons-fileupload-X.X.X.jar freemarker-X.X.X.jar javassist-X.X.X.jar ognl-X.X.X.jar struts2-core-X.X.X.X.jar xwork-core-X.X.X.jar 4. Add the struts.xml to 'src' folder in the Web Project. 5. Register the Action in struts cconfiguration file. 6. Create the Action Class by extending the com.opensymphony.xwork2.ActionSuppor t Class 7. Override the execute method. 8. Call the Action from the web Pages.

Вам также может понравиться