Struts:The good, the bad, the ugly A detailed evaluation of Struts 1.1 and Enterprise Web Applications. By Paul Smith Ancept, Inc. (www.ancept.com) www.ancept.com.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10 Servlets and Java Server Pages.
Advertisements

Struts Portlet Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Web Development with Karsten Schulz Terp-Nielsen Master Principal Sales Consultant Oracle Denmark.
Apache Struts Technology
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Web Applications Development Using Coldbox Platform Eddie Johnston.
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
Struts1 Apache Struts Dr Jim Briggs. Struts2 What is Struts? Struts is an open source framework for building Java web applications Supports MVC/Model.
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
Struts Basics SSE USTC Qing Ding. Agenda What is and Why Struts? Struts architecture – Controller: Focus of this presentation – Model – View Struts tag.
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Apache Struts Technology A MVC Framework for Java Web Applications.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Java Enterprise Edition Java Web Development Structure of a web project Introduction to Web Applications The first project Introduction to Java Web Development.
Struts 2.0 an Overview ( )
Struts. Agenda Preface Struts and its components An example The architecture required for Struts Applications.
UNIT-V The MVC architecture and Struts Framework.
Introduction to the Jakarta Struts Framework  The Topics: JavaServer Pages (JSP) Overview JSP Tags and Tag Libraries Overview Model – View – Controller.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
Java Frameworks Indy Java Users Group January 29, 2003.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
1 INTRO TO BUSINESS COMPONENTS FOR JAVA (BC4J) Matt Fierst Computer Resource Team OracleWorld Session
Author: DoanNX Version 2.0/Time: 30’. The ways to solve it There are 2 main ways:  Client-side: Using JavaScript (now one very good option is JQuery).
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
JSP Architecture Outline  Model 1 Architecture  Model 2 Architecture.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
8/15/2003System Specialists Corporation How to implement BC4J with the Struts Framework Eugene Sicat Technical Architect/Project Manager System Specialists.
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Struts J2EE web application framework “ Model 2 ” Model View Controller Controller Servlet Key features XML metadata Struts taglib Simplified form validation.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Fall CIS 764 Database Systems Design L8. Web ….
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
How to Build a Struts Application with JBuilder 9.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
BOF # The Struts Framework Community The Struts Framework Community Craig McClanahan.
JAVA SERVER FACES ADITI RAJORIYA UNI – ar2630. POINTS TO BE DISSCUSED WHAT IS JSF? WHY JSF? ARCHITECTURE JSF VERSIONS UI COMPONENTS JSF STRUCTURE AND.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Forms with Spring MVC Handling Form.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Java Server Pages (JSP)
Struts Framework Anna Paščenko. What is Struts?  An open source framework for building Java web applications.
Apache Struts. J2EE Web Application using MVC design pattern Why MVC? Separate components = easier maintenance – Model component holds object data – View.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
13 Copyright © 2004, Oracle. All rights reserved. Adding Validation and Error Handling.
11 Copyright © 2004, Oracle. All rights reserved. Customizing Actions.
Struts Framework Day-2 Ashok Chakravarti. DataSource Usage Sample Struts-config.xml …
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
APACHE STRUTS ASHISH SINGH TOMAR ast2124. OUTLINE Introduction The Model-View-Controller Design Pattern Struts’ implementation of the MVC Pattern Additional.
Apache Struts Technology A MVC Framework for Java Web Applications.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
V Web Tier Architecture MVC and Struts. v First, there were servlets And things were good Faster than CGI programs More scalable with built-in.
Enterprise Java v050228MVC1 Model, View, Controller Web Architecture.
Recent trends in estimation methodologies
Unit 6-Chapter 2 Struts.
Design and Maintenance of Web Applications in J2EE
Introduction to Struts
The Model Layer What is Model?
JavaServer Faces: The Fundamentals
SDMX IT Tools SDMX Registry
Presentation transcript:

Struts:The good, the bad, the ugly A detailed evaluation of Struts 1.1 and Enterprise Web Applications. By Paul Smith Ancept, Inc. (

Presentation Overview Themes Themes Struts Overview (Basic Features) Struts Overview (Basic Features) Development Challenges in 1.0 Development Challenges in 1.0 –Problem Description –Solution in 1.1 –Example Architectural Challenges Struts Applications Architectural Challenges Struts Applications –Problem Description –Possible Solution Q & A Q & A

Themes 1. Struts 1.1 provides small to medium sized applications all the functionality they should need “out of the box” 2. A large project team should be aware of limitations of Struts 1.1 which may require customized solutions 3. Large architecture teams may need a custom implementation of Struts 1.1 to enterprise class architectures

Supporting the Themes To illustrate the themes: To illustrate the themes: –Section 1 describes Struts basic features –Section 2 describes the new features of Struts 1.1 and why they exist –Section 3 describes architectural challenges in large projects and possible solutions

Section 1-Basic Features Why Use A Framework Why Use A Framework Struts Overview Struts Overview

Why Use the Struts Framework A pre-built framework is better than roll- your-own A pre-built framework is better than roll- your-own Increased productivity in JSP production Increased productivity in JSP production Cleaner design Cleaner design More time on business logic More time on business logic

Easier than building your own Probably very similar to what you would end up building anyway Probably very similar to what you would end up building anyway Strong industry support instead of your own custom framework Strong industry support instead of your own custom framework The Struts framework is configurable so it will probably work for your project without building your own The Struts framework is configurable so it will probably work for your project without building your own Customizing open-source is simpler than building from scratch Customizing open-source is simpler than building from scratch

JSP Productivity Writing pages in Struts is roughly 40-60% faster than without struts because you use tags NOT java code Writing pages in Struts is roughly 40-60% faster than without struts because you use tags NOT java code The custom tags, form object, messages architecture makes data display easy (for medium sized apps) The custom tags, form object, messages architecture makes data display easy (for medium sized apps) Tiles development helps manage page complexity Tiles development helps manage page complexity

Cleaner Design Struts applications are easier to develop and maintain because the design concepts are elegant Struts applications are easier to develop and maintain because the design concepts are elegant –Non-technical staff better understands layout and design –Since code is targeted at specific business problems, the team communicates better –Design is easier to expand for very large application architectures

More Time on Business Logic Less coding of web infrastructure means more time for business logic: Less coding of web infrastructure means more time for business logic: –Page flow design –Action execution synchronization –Page model objects –Validation –Page templates Focus on re-usable custom frameworks to use with Struts (J2EE integration, Web services) Focus on re-usable custom frameworks to use with Struts (J2EE integration, Web services)

Struts Overview Struts Description Struts Description Common Infrastructure Tasks Common Infrastructure Tasks Struts Solutions to Infrastructure Tasks Struts Solutions to Infrastructure Tasks How does Struts works How does Struts works The Struts Configuration File The Struts Configuration File Where does it fit in J2EE applications Where does it fit in J2EE applications Case Study Case Study

Struts Description Struts is a Web Application Framework (custom tag libraries, servlet, xml control files) which increase the productivity of web developers Struts is a Web Application Framework (custom tag libraries, servlet, xml control files) which increase the productivity of web developers Struts was invented by Craig McClanahan in 2000 Struts was invented by Craig McClanahan in 2000 Struts solves common problems with web application development by abstracting common infrastructure tasks Struts solves common problems with web application development by abstracting common infrastructure tasks

Common Infrastructure Tasks Page flow design and control Page flow design and control Code execution framework (Command Pattern) Code execution framework (Command Pattern) Automated data objects (MVC Pattern) Automated data objects (MVC Pattern) Easy to use custom tags for display Easy to use custom tags for display Validation Validation Page templates & layout Page templates & layout Re-usable text messages Re-usable text messages Much more… Much more…

Struts Solutions to Infrastructure Forwards: Page flow design and control Forwards: Page flow design and control Actions: Code execution framework (Command Pattern) Actions: Code execution framework (Command Pattern) Forms: Automated data objects (MVC Pattern) Forms: Automated data objects (MVC Pattern) Struts Tags: Easy to use custom tags for display Struts Tags: Easy to use custom tags for display Validator: Validation Validator: Validation Tiles: Page templates & layout Tiles: Page templates & layout Message Resources: Handles re-usable text messages in multiple languages Message Resources: Handles re-usable text messages in multiple languages

How Struts Works

Struts Configuration Struts is controlled by a Configuration file Struts is controlled by a Configuration file Struts Configuration contains: Struts Configuration contains: –Form Definitions: Data objects for JSP pages –Forward Definitions: Abstract pages for page flow control –Action Definitions: maps requests to Command class –Message Resources: Storage of common text messages –Plug-In Definitions: Startup classes used for initializing custom functionality

Where does Struts fit into J2EE

Case Study Department of Transportation created an aircraft registration application for internal staff (J2EE with a 2 nd Generation Framework) Department of Transportation created an aircraft registration application for internal staff (J2EE with a 2 nd Generation Framework) 100 JSPs 100 JSPs 13.5 k lines of code in the web tier (no business logic) k lines of code in the web tier (no business logic). 20,000 lines of code for business logic. 20,000 lines of code for business logic. 8 months of development with a team of 5 8 months of development with a team of 5

Section 1 Conclusion Struts base feature-set include significant functionality for small to medium applications Struts base feature-set include significant functionality for small to medium applications Small applications should not need to customize Struts significantly: Small applications should not need to customize Struts significantly: –Form objects and Action classes provide MVC design –Action classes house functional code –Forwards abstract page flow control –Form objects and Struts tags provide page display –Tiles provides flexible page layout –Validator provides flexible form/page level validation –Message Resources provide re-usable text

Development Challenges in 1.0 Large Numbers of Form Classes Large Numbers of Form Classes Large teams and Resources Large teams and Resources Handling Errors More Flexibly Handling Errors More Flexibly Problems with Page Layout Problems with Page Layout Validating Pages and Forms Validating Pages and Forms Initializing Custom Functionality Initializing Custom Functionality

Lots of Form Classes In Struts 1.0 developers had to write a custom class for every form (generally 1 per JSP form) In Struts 1.0 developers had to write a custom class for every form (generally 1 per JSP form) Form classes are generally very simple Form classes are generally very simple Task assigned to junior programmers (drudge work) Task assigned to junior programmers (drudge work) Form classes sometimes not consistent Form classes sometimes not consistent

1.1 Solution Dynamic Form Objects Declare Forms in the struts-config.xml file Declare Forms in the struts-config.xml file Form objects are created when the action executes and stored in the session or request scope Form objects are created when the action executes and stored in the session or request scope Form fields are set and retrieved using the PropertyUtils.setSimpleProperty(…) method or treated as HashMap Form fields are set and retrieved using the PropertyUtils.setSimpleProperty(…) method or treated as HashMap

Dynamic Form Example Declaration<form> </form> Java Use Public void execute(mapping, form, …){ String testProp = (String)PropertyUtils.getSimpleProperty(form, “testProp”); PropertyUtils.setSimpleProperty(form, “testProp”, value); }

Large Teams and Resources It has been difficult to co-ordinate the struts-config file and other resources with large teams and projects It has been difficult to co-ordinate the struts-config file and other resources with large teams and projects Resources declared in config file might need to be different for portions of the application (shippingForm) Resources declared in config file might need to be different for portions of the application (shippingForm) Partitioning development teams has been somewhat difficult Partitioning development teams has been somewhat difficult

1.1 Solution: Modules Separate, independent applications (uses different configuration file) under “default” application Separate, independent applications (uses different configuration file) under “default” application Modules are based on paths (xyz.com/app/sub- app) and web.xml entries Modules are based on paths (xyz.com/app/sub- app) and web.xml entries Created to modularize large applications Created to modularize large applications –Break modules up according to team Unable to share resources between modules Unable to share resources between modules

Module Example Jakarta Struts 1.1: Ready for Prime TimeJakarta Struts 1.1: Ready for Prime Time (PDF) by Chuck Cavaness.

Handling Errors Struts 1.0 applications had to do all of their error handling inside the Action classes Struts 1.0 applications had to do all of their error handling inside the Action classes This could mean a significant amount duplication of error handling code This could mean a significant amount duplication of error handling code Some large apps had to customize the framework to do flexible error handling Some large apps had to customize the framework to do flexible error handling

1.1 Solution: Declarative Error Handling Provides global and per Action handling of errors Provides global and per Action handling of errors Declare errors by Exception class Declare errors by Exception class Create custom error handlers by implementing interface Create custom error handlers by implementing interface

Error Handling Example Declaration<global-exceptions> </global-exceptions> Java Use public ActionForward execute( Exception ex, ExceptionConfig exConfig, ActionMapping mapping, ActionForm formInstance, HttpServletRequest request, HttpServletResponse response ) throws ServletException { handle error… return mapping.findForward(“errorPage”); }

Problems with Page Layout Struts 1.0 provided some page layout mechanism Struts 1.0 provided some page layout mechanism Large application pages can get very complicated without a better layout mechanism Large application pages can get very complicated without a better layout mechanism 1.0 version could not change based on Locale 1.0 version could not change based on Locale 1.0 version did not have significant re-use functionality 1.0 version did not have significant re-use functionality

1.1 Solution:Tiles Integration Tiles code has been integrated into core Struts Tiles code has been integrated into core Struts Tiles provides flexible page layout and re- use mechanism Tiles provides flexible page layout and re- use mechanism Provides support for Locales Provides support for Locales Tiles can be nested Tiles can be nested Tiles can be used as Struts Forwards by tile name Tiles can be used as Struts Forwards by tile name

Tiles Example Tiles-Config.xml<definitions> </definition> <definition name=“home.default” extends=“home.default”/> </definition></definitions>Index.jsp <html:html><body> …

Validating Pages and Forms Struts 1.0 only provided automatic support for validating form objects (by calling the validate method) Struts 1.0 only provided automatic support for validating form objects (by calling the validate method) Programmers had to implement validation code inside of the class (ex. making sure phone was really a number) by hand Programmers had to implement validation code inside of the class (ex. making sure phone was really a number) by hand Client-side validation had to be implemented by hand Client-side validation had to be implemented by hand

1.1 Solution: Validator Integration Validator integrated into core code base Validator integrated into core code base Use a xml file to declaratively validate form objects Use a xml file to declaratively validate form objects Validators are keyed against the form by name Validators are keyed against the form by name Comes with many pre-built validators (e- mail, date, etc) Comes with many pre-built validators (e- mail, date, etc) Supports client-side (JavaScript) and server-side validation Supports client-side (JavaScript) and server-side validation

Validator Config Example Struts-Config.xml </form>Validator.xml <field property=“address” depends=“required, mask”/> depends=“required, mask”/> <var> mask mask ^\w+$ ^\w+$ </var></field>…

Validator JSP Example Index.jsp <html:html><body> (this makes the form call the validation JavaScript onSubmit) <table>…etc.</table> (This inserts the javascript which executes the validation) (This inserts the javascript which executes the validation)…

Initializing Custom Functionality Often custom applications need to initialize information when the application starts up Often custom applications need to initialize information when the application starts up Since Struts runs off of a servlet this was very difficult Since Struts runs off of a servlet this was very difficult

1.1 Solution: Plug-Ins Plug-Ins provide a means for initializing components on application startup Plug-Ins provide a means for initializing components on application startup Provide means for Factory functionality or customization Provide means for Factory functionality or customization Init-parameters let you pass information into plug-in Init-parameters let you pass information into plug-in

Plug-in Example Struts-Config.xml </plug-in> TestPlugin Code public void init(ActionServlet servlet, ApplicationConfig config) { perform initialization… } Public void destroy() { perform shutdown… }

Section 2 Conclusion Struts 1.1 has added significant functionality to help medium to large application teams Struts 1.1 has added significant functionality to help medium to large application teams Even large application teams should be able to use Struts without actually modifying the underlying Struts code: Even large application teams should be able to use Struts without actually modifying the underlying Struts code: –Plug-ins allow initialization of advanced “patterns” –Declarative error handling allows re-use of error code –Dynamic forms save tremendous effort –Validation saves significant effort –Modules provide large team partitioning

Architectural Challenges “Contextual” Pages & Declarative Branching “Contextual” Pages & Declarative Branching Composable Actions Composable Actions Re-Use Re-Use Event Handling Event Handling J2EE Integration J2EE Integration Content Management Integration Content Management Integration

Contextual Pages Sometimes the developer wants to use JSPs in different locations in the page flow Sometimes the developer wants to use JSPs in different locations in the page flow These pages and their associated action classes must then have large if/then blocks These pages and their associated action classes must then have large if/then blocks Certain types of context tracking are almost impossible without extending the framework (dynamically modifying actions, etc) Certain types of context tracking are almost impossible without extending the framework (dynamically modifying actions, etc)

Contextual Pages

Declarative Branching

Solutions: Context Subsystem Create Context object which tracks the “path” the user has traveled Create Context object which tracks the “path” the user has traveled Create ContextualAction super-class which adds the page and action to the context Create ContextualAction super-class which adds the page and action to the context Make all Action classes subclass ContextualAction and use path history for logic Make all Action classes subclass ContextualAction and use path history for logic

Composable Actions Actions are currently made up of only one class file Actions are currently made up of only one class file To partition an Action the developer must use large if/then blocks and Request properties To partition an Action the developer must use large if/then blocks and Request properties The developer must put all of this code in one action or write custom JavaScript to call different actions based on the users mouse-click The developer must put all of this code in one action or write custom JavaScript to call different actions based on the users mouse-click This is not made easy for the developer and can cause problems if not thought through early on This is not made easy for the developer and can cause problems if not thought through early on

Composable Actions

Solution:Composable Actions Some amount of “composition” can be achieved using local ActionForwards Some amount of “composition” can be achieved using local ActionForwards Better composition can be achieved with the Better composition can be achieved with the Struts Action Plug-in Extension by ASQdotCOMASQdotCOM Struts 2.0 should have a “workflow” component to compose actions from re- usable steps

Solution:Composable Actions Step 1:Write a Java class that implements the ActionPlugIn interface, to create an action plug-in. Step 1:Write a Java class that implements the ActionPlugIn interface, to create an action plug-in. Step 1: Step 1: Step 2:Declare (and configure) the action plug-in that you created in step 1 in the action-plug-in-config.xml configuration file. Step 2:Declare (and configure) the action plug-in that you created in step 1 in the action-plug-in-config.xml configuration file. Step 2: Step 2: Step 3:Add a Struts tag to the struts- config.xml configuration file to get the action plug-in chain initialized on application start-up. Step 3:Add a Struts tag to the struts- config.xml configuration file to get the action plug-in chain initialized on application start-up. Step 3: Step 3: Step 4:Make sure that there is a tag specified in the struts-config.xml configuration file, that has its processClass attribute set to be.ff.web.struts.action.ActionPlugInRequestProcessor. Step 4:Make sure that there is a tag specified in the struts-config.xml configuration file, that has its processClass attribute set to be.ff.web.struts.action.ActionPlugInRequestProcessor. Step 4: Step 4:

Solution:Composable Actions Declaration<action-plug-in-config> ActionPlugIn ActionPlugIn <init-params><init-params> /logon /logon</disabled-for></action-plug-in> WorkflowActionP lugIn WorkflowActionP lugIn </action-plug-in> Java Use public ActionForward execute() throws ActionPlugInException { UserAccount account = (UserAccount) session.getAttribute(accountSessionKey); if (account == null) { if (account == null) { return mapping.findForward("logon"); } else { return chain.execute(mapping, form, request, response); }

Re-Use There are two possibilities for re-use in Struts, pages and actions There are two possibilities for re-use in Struts, pages and actions Re-use of actions is very difficult because: Re-use of actions is very difficult because: –the granularity of the actions is too high (one action per page) –The actions cannot be chained together or segmented Re-use of pages in struts is very difficult because: Re-use of pages in struts is very difficult because: –There is no context object tracking location, etc. –There is no way of overriding a page/form declaration within a context

Action Re-use

J2EE Integration Struts does not provide any out of the box functionality for J2EE integration (EJBs, JDO, JDBC, JMS, JavaMail) Struts does not provide any out of the box functionality for J2EE integration (EJBs, JDO, JDBC, JMS, JavaMail) Each project/development team must decide ahead of time on a mechanism to do J2EE integration Each project/development team must decide ahead of time on a mechanism to do J2EE integration Developers must build their own frameworks for J2EE integration even in very simple applications Developers must build their own frameworks for J2EE integration even in very simple applications

Solution: J2EE Integration Create Declarative support for long-lived model objects (beyond forms) Create Declarative support for long-lived model objects (beyond forms) Create Struts J2EE integration (session and entity beans) using dynamic value objects and session bean proxies Create Struts J2EE integration (session and entity beans) using dynamic value objects and session bean proxies Create Struts JDO integration Create Struts JDO integration

Solution: J2EE Integration

Events Struts provides no mechanism for event based functionality Struts provides no mechanism for event based functionality Though not strictly required, it is often much easier to write some function using an event Though not strictly required, it is often much easier to write some function using an event For example, if you want to run some function every time the user goes to the edit page, but the edit page can be reached by 10 different actions… For example, if you want to run some function every time the user goes to the edit page, but the edit page can be reached by 10 different actions…

Solution: Event Subsystem Create an Event Multicaster/Controller to manage event listeners and publish specific events Create an Event Multicaster/Controller to manage event listeners and publish specific events Most useful events are Navigation, Action, Form events Most useful events are Navigation, Action, Form events Create Action Superclass which fires navigation and action events Create Action Superclass which fires navigation and action events Create Dynamic form superclass which fires form events Create Dynamic form superclass which fires form events

Solution: Event Subsystem Fire Navigate Event Fire Action Event

Content Integration Struts provides very little in terms of content management integration. Struts provides very little in terms of content management integration. If your team uses custom content management systems, you will have to customize the own framework If your team uses custom content management systems, you will have to customize the own framework The message framework in Struts is only acceptable for small to medium applications The message framework in Struts is only acceptable for small to medium applications

Solution: Content Integration Customize Message Resources classes to handle more advanced input Customize Message Resources classes to handle more advanced input Customize Validator framework to handle more advanced input Customize Validator framework to handle more advanced input Possible input mechanisms: Possible input mechanisms: –Xml files –Content Management Systems –DBMS

Section 3 Conclusion While Struts 1.1 provides excellent features for web applications it may be deficient for Enterprise class architectures While Struts 1.1 provides excellent features for web applications it may be deficient for Enterprise class architectures Large Application Teams may need to create a custom Struts implementation to accomplish: Large Application Teams may need to create a custom Struts implementation to accomplish: –Contextual Page Handling –Dynamic Action Branching and page flow –Composable Actions for Re-Use –Significant J2EE integration –Event Handling –Content Management Integration

Resources Struts website: Struts website: Struts Action Plug-in Extension 1.0.2: Struts Action Plug-in Extension 1.0.2: Struts workflow proposal: Struts workflow proposal: Struts Resources: Struts Resources: