Apachecon 2002 Struts

2,221 views

Published on

Published in: Technology, Education
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
2,221
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
36
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Apachecon 2002 Struts

  1. 1. <ul><ul><li>Building Web Applications With The Struts Framework </li></ul></ul><ul><ul><li>Session WE06 – 11/20/2002 – 10:00-11:00 </li></ul></ul><ul><ul><li>Craig R. McClanahan </li></ul></ul><ul><ul><li>Senior Staff Engineer </li></ul></ul><ul><ul><li>Sun Microsystems, Inc. </li></ul></ul>
  2. 2. Session Outline <ul><li>Web Applications Backgrounder </li></ul><ul><li>The Model-View-Controller Architecture </li></ul><ul><li>The Struts Framework </li></ul><ul><li>Building A Web Application With Struts </li></ul><ul><li>Resources </li></ul>
  3. 3. <ul><ul><li>Web Applications Backgrounder </li></ul></ul>
  4. 4. Web Applications Backgrounder <ul><li>Web applications run over the HTTP protocol: </li></ul><ul><ul><li>Request/response oriented </li></ul></ul><ul><ul><li>Stateless </li></ul></ul><ul><li>Web applications use varied presentation (markup) languages, and talk to varied client hardware devices: </li></ul><ul><ul><li>“ Standard HTML” -- not! </li></ul></ul><ul><ul><li>Varying dynamic and JavaScript capabilities </li></ul></ul><ul><ul><li>Wireless devices vary in capabilities, language dialect, and input device support </li></ul></ul>
  5. 5. Simple Solutions ... for Simple Problems <ul><li>For relatively simple applications, a simple architecture works fine </li></ul><ul><li>For each page in the user interface ... </li></ul><ul><ul><li>Create a servlet, JSP page, or something similar </li></ul></ul><ul><ul><li>The page includes: </li></ul></ul><ul><ul><ul><li>Logic to create the user interface </li></ul></ul></ul><ul><ul><ul><li>Logic to retrieve required information from the database </li></ul></ul></ul><ul><ul><ul><li>Logic to perform the appropriate business transaction </li></ul></ul></ul><ul><ul><ul><li>Logic to update the corresponding database information </li></ul></ul></ul><ul><ul><li>And it's all mixed together in one source file </li></ul></ul><ul><li>This works fine for a Guest Book app, but what about something bigger? </li></ul>
  6. 6. What About Large Scale Applications? <ul><li>Disparate skill sets required: </li></ul><ul><ul><li>Presentation Layer -- User interface design, visual appearance, interaction model </li></ul></ul><ul><ul><li>Application Layer – Functional business logic to perform required transactions </li></ul></ul><ul><ul><li>Persistence Layer – Databases, directory servers, messaging, Enterprise JavaBeans TM (EJBs) </li></ul></ul><ul><ul><li>Application Deployment – Networks, firewalls, public key infrastructures, load balancing, failover </li></ul></ul><ul><li>We need a fundamental organizing principle: </li></ul><ul><ul><li>The Model-View-Controller (MVC) architecture </li></ul></ul>
  7. 7. <ul><ul><li>The Model-View-Controller (MVC) Architecture </li></ul></ul>
  8. 8. The Model-View-Controller Architecture <ul><li>Divides the overall functionality of an application into three layers: </li></ul><ul><ul><li>Model Layer – Contains the functional business logic of the application, as well as a representation of the persistently stored data backing the application </li></ul></ul><ul><ul><li>View Layer – Contains the user interface, including mechanisms to accept user input and render results </li></ul></ul><ul><ul><li>Controller Layer – Contains the logic that manages the flow of individual requests, dispatching to the appropriate business logic component </li></ul></ul>
  9. 9. The Model Layer <ul><li>Functional business logic: </li></ul><ul><ul><li>Should be modelled as JavaBeans or Session EJBs </li></ul></ul><ul><ul><li>Should be reusable in non-web environments </li></ul></ul><ul><ul><li>API exposes public methods for each logical unit of work (while hiding the details) </li></ul></ul><ul><li>Persistent data storage: </li></ul><ul><ul><li>Should manage permanent storage of application data </li></ul></ul><ul><ul><li>Typically shared across many applications </li></ul></ul><ul><ul><li>API should expose data retrieval and storage operations (while hiding the mechanisms) </li></ul></ul>
  10. 10. The View Layer <ul><li>Creation of the user interface: </li></ul><ul><ul><li>Typically in HTML or an XML-based dialect </li></ul></ul><ul><ul><li>Normally a combination of static and dynamic content </li></ul></ul><ul><li>Actual content varies depending on: </li></ul><ul><ul><li>Device or browser type </li></ul></ul><ul><ul><li>User preferences / personalization </li></ul></ul><ul><ul><li>Internationalization and localization requirements </li></ul></ul><ul><ul><li>Accessibility requirements </li></ul></ul>
  11. 11. The Controller Layer <ul><li>Incoming requests flow through a common path: </li></ul><ul><ul><li>Received by common component </li></ul></ul><ul><ul><li>Standardized request pre-processing </li></ul></ul><ul><ul><li>Dispatch to request-specific model component (business logic) </li></ul></ul><ul><ul><li>Forward to business-logic-specified view component </li></ul></ul><ul><ul><li>Standardized request post-processing </li></ul></ul><ul><li>Often called “Model 2 Design” in the JSP/Servlet community </li></ul><ul><li>In modern design pattern terminology, Struts implements the front controller pattern. </li></ul>
  12. 12. <ul><ul><li>The Struts Framework – An Implementation of the MVC Architecture </li></ul></ul>
  13. 13. The Struts Framework – Architecture
  14. 14. The Struts Framework – Model Layer <ul><li>Struts does not restrict implementation techniques for model layer </li></ul><ul><ul><li>JDBC-accessed databases </li></ul></ul><ul><ul><li>Enterprise JavaBeans </li></ul></ul><ul><ul><li>O-R mapping tools </li></ul></ul><ul><li>Optional JDBC connection pool available </li></ul><ul><li>Common design pattern: </li></ul><ul><ul><li>Action acquires information from persistence tier </li></ul></ul><ul><ul><li>Exposes information as request/session attributes </li></ul></ul><ul><ul><li>View layer pulls data from attributes for display </li></ul></ul>
  15. 15. The Struts Framework – View Layer <ul><li>Form Bean maintains state of form input fields across requests: </li></ul><ul><ul><li>ActionForm – Standard JavaBean design pattern </li></ul></ul><ul><ul><li>DynaActionForm – Property names and types defined in Struts configuration file </li></ul></ul><ul><li>In addition to properties, form beans define two standard methods: </li></ul><ul><ul><li>reset() -- Reset form properties to initial state </li></ul></ul><ul><ul><li>validate() -- Perform field-level validations </li></ul></ul><ul><li>Form bean properties are typically Strings </li></ul><ul><ul><li>Allows redisplay of invalid input </li></ul></ul>
  16. 16. The Struts Framework – View Layer <ul><li>Internationalization Support enables locale-specific applications </li></ul><ul><ul><li>Locale – Standard Java class representing a choice of language and/or country </li></ul></ul><ul><ul><li>MessageFormat – Standard Java class representing an individual message with replaceable parameters: </li></ul></ul><ul><ul><ul><li>“ {0} is not a valid credit rating” </li></ul></ul></ul><ul><ul><li>MessageResources – Struts abstraction around sets of messages for supported locales </li></ul></ul><ul><ul><li>ActionErrors / ActionMessages – Struts collections of localized messages </li></ul></ul>
  17. 17. The Struts Framework – View Layer <ul><li>JSP Custom Tag Libraries – If you are using JSP pages for your presentation </li></ul><ul><ul><li>struts-bean.tld – Fundamental bean manipulation and internationalization </li></ul></ul><ul><ul><li>struts-html.tld – “Smart” HTML elements </li></ul></ul><ul><ul><li>struts-logic.tld – Basic conditionals and iteration </li></ul></ul><ul><ul><li>struts-template.tld – Basic layout management </li></ul></ul>
  18. 18. The Struts Framework – View Layer <ul><li>Standard tag libraries added in Struts 1.1: </li></ul><ul><ul><li>struts-nested.tld -- “Nested” variants of standard tags that resolve relative references against beans </li></ul></ul><ul><ul><li>struts-tiles.tld – Full features layout management library </li></ul></ul><ul><li>Contributed libraries added in Struts 1.1: </li></ul><ul><ul><li>struts-xxx-el.tld – Versions of standard Struts tag libraries that support the expression language syntax of JSP Standard Tag Library </li></ul></ul>
  19. 19. The Struts Framework – View Layer <ul><li>Validation Framework </li></ul><ul><ul><li>No-code-required field level validations </li></ul></ul><ul><ul><li>Configured in an XML document included in the web application </li></ul></ul><ul><ul><li>Optionally generates client side JavaScript to enforce validation rules </li></ul></ul><ul><ul><li>Extensible architecture </li></ul></ul>
  20. 20. The Struts Framework – Controller Layer <ul><li>ActionServlet – Standard implementation of controller </li></ul><ul><li>At application startup, reads configuration file and initializes resources </li></ul><ul><ul><li>[Struts 1.1] PlugIn – General start/stop hook </li></ul></ul><ul><li>On each request, implements the standard Struts request processing lifecycle (in Struts 1.1, implemented in RequestProcessor ) </li></ul><ul><li>Specialization / customization via subclassing </li></ul><ul><li>[Struts 1.1] Sub-application modules support </li></ul>
  21. 21. The Struts Framework – Controller Layer <ul><li>Action – Standard base class for business logic components and adapters: </li></ul><ul><ul><li>Mapped to logical names by request processor </li></ul></ul><ul><ul><li>Single instance per application (must be thread safe) </li></ul></ul><ul><ul><li>Instantiated as needed, like servlets </li></ul></ul><ul><li>Implements the “Command Pattern” </li></ul><ul><ul><li>execute() -- Invoked for each request </li></ul></ul><ul><ul><li>Can (but typically does not) create response content directly </li></ul></ul><ul><ul><li>Typically returns ActionForward to select resource to prepare response </li></ul></ul>
  22. 22. The Struts Framework – Controller Layer <ul><li>Standard Request Processing Lifecycle 1: </li></ul><ul><ul><li>processLocale() -- Record user's locale preference (if not already present) </li></ul></ul><ul><ul><li>processPreprocess() -- general purpose pre-processing hook </li></ul></ul><ul><ul><li>processMapping() -- select Action to be utilized </li></ul></ul><ul><ul><li>processRoles() -- perform security role-based restrictions on action execution </li></ul></ul><ul><ul><li>processActionForm() -- Create or acquire an appropriate ActionForm instance </li></ul></ul>
  23. 23. The Struts Framework – Controller Layer <ul><li>Standard Request Processing Lifecycle 2: </li></ul><ul><ul><li>processPopulate() -- Copy the request parameters into the form bean properties </li></ul></ul><ul><ul><li>processValidate() -- Call form bean's validate() method </li></ul></ul><ul><ul><li>processActionCreate() -- Create or acquire an appropriate Action instance </li></ul></ul><ul><ul><li>processActionPerform() -- Call action's execute() method </li></ul></ul><ul><ul><li>processActionForward() -- Process returned ActionForward instance (if any) </li></ul></ul>
  24. 24. The Struts Framework – Controller Layer <ul><li>XML Configuration Document (/WEB-INF/struts-config.xml) </li></ul><ul><ul><li>Standard place to configure all aspects of the application's behavior </li></ul></ul><ul><ul><li>DTD included for optional (but recommended) validation </li></ul></ul><ul><ul><li>Logical-to-physical mappings for Actions, ActionForms, and ActionForwards </li></ul></ul><ul><ul><li>General configuration settings </li></ul></ul><ul><li>[Struts 1.1] Configuration Document per module if more than one </li></ul>
  25. 25. The Struts Framework – Commons Libraries <ul><li>Non-Struts Specific Logic Factored Out: </li></ul><ul><ul><li>commons-beanutils – Generic bean property manipulation </li></ul></ul><ul><ul><li>commons-collections – Extensions to standard Java2 collections classes </li></ul></ul><ul><ul><li>commons-dbcp – Optional JDBC connection pool </li></ul></ul><ul><ul><li>commons-digester – XML parsing for configuration files </li></ul></ul><ul><ul><li>commons-fileupload – Support library for HTML file uploads </li></ul></ul>
  26. 26. The Struts Framework – Commons Libraries <ul><li>Non-Struts Specific Logic Factored Out: </li></ul><ul><ul><li>commons-logging – Application logging wrapper </li></ul></ul><ul><ul><li>commons-pool – Object pooling library </li></ul></ul><ul><ul><li>commons-resources – Message resources support library </li></ul></ul><ul><ul><li>Commons-validator – Field validation framework </li></ul></ul>
  27. 27. <ul><ul><li>Building Web Applications With Struts </li></ul></ul>
  28. 28. Building Web Applications With Struts <ul><li>Now that we understand the architecture of Struts, let's look at parts of an example app that is built with it </li></ul><ul><li>Struts includes a canonical example that is useful in determining whether you have installed things correctly </li></ul><ul><ul><li>struts-example.war </li></ul></ul><ul><li>Application models (part of) an email portal site that lets you maintain multiple subscriptions </li></ul>
  29. 29. Sample Application – Model Layer (Persistence Tier) <ul><li>Modelled via a Data Access Object (DAO) </li></ul><ul><ul><li>org.apache.struts.webapp.example.UserDatabase </li></ul></ul><ul><li>public interface UserDatabase { </li></ul><ul><li>public User createUser(String username); </li></ul><ul><li>public void close() throws Exception; </li></ul><ul><li>public User findUser(String username); </li></ul><ul><li>public User[] findUsers(); </li></ul><ul><li>public void open() throws Exception; </li></ul><ul><li>public void removeUser(User user); </li></ul><ul><li>public void save() throws Exception; </li></ul><ul><li>} </li></ul>
  30. 30. Sample Application – Model Layer (Persistence Tier) <ul><li>Default implementation based on loading an XML document into memory: </li></ul><ul><ul><li>o.a.s.e.memory.MemoryUserDatabase </li></ul></ul><ul><li>JDBC-based (or LDAP-based) implementation is easy to imagine, and would be transparent to the business logic </li></ul><ul><li>Implementation selection implemented via a PlugIn ... see configuration file example later </li></ul>
  31. 31. Sample Application – Model Layer (Business Logic) <ul><li>Two common Struts design patterns illustrated </li></ul><ul><li>View --> View --> Action </li></ul><ul><ul><li>Welcome Page has link to logon page: </li></ul></ul><ul><ul><ul><li><html:link page=”/logon.jsp”>...</html:link> </li></ul></ul></ul><ul><ul><li>Logon page instantiates LogonForm bean </li></ul></ul><ul><ul><li>Form submit goes to “/logon” action </li></ul></ul><ul><li>View --> Action --> View --> Action </li></ul><ul><ul><li>Setup action “/editRegistration?action=Edit” pulls data from “database” and populates form bean </li></ul></ul><ul><ul><li>Registration page “ /registration.jsp” displays current data </li></ul></ul><ul><ul><li>Form submit goes to “/saveRegistration” action </li></ul></ul>
  32. 32. Sample Application – View Layer (logon.jsp) <ul><li><%@ page contentType=”text/html;charset=”UTF-8” %> </li></ul><ul><li><%@ taglib uri=”/WEB-INF/struts-bean.tld” </li></ul><ul><li>prefix=” bean ” %> </li></ul><ul><li><%@ taglib uri=”/WEB-INF/struts-html.tld” </li></ul><ul><li>prefix=” html ” %> </li></ul><ul><li>< html:html locale=”true”> </li></ul><ul><li><head> </li></ul><ul><li><title> </li></ul><ul><li>< bean:message key=”logon.title”/> </li></ul><ul><li></title> </li></ul><ul><li>< html:base /> </li></ul><ul><li></head> </li></ul>
  33. 33. Sample Application – View Layer (logon.jsp) <ul><li><body bgcolor=”white”> </li></ul><ul><li>< html:errors /> </li></ul><ul><li>< html:form action=”/logon” focus=”username” </li></ul><ul><li>onsubmit=”return validateLogonForm(this);”> </li></ul><ul><li><table border=”0” width=”100%”> </li></ul><ul><li><tr> </li></ul><ul><li><th align=”right”> < bean:message key=”prompt.username”/> </li></ul><ul><li></th> </li></ul><ul><li><td align=”left”> </li></ul><ul><li>< html:text property=”username” size=”16”/> </li></ul><ul><li></td> </li></ul><ul><li></tr> </li></ul>
  34. 34. Sample Application – View Layer (logon.jsp) <ul><li><tr> </li></ul><ul><li><th align=”right”> < bean:message key=”prompt.password”/> </li></ul><ul><li></th> </li></ul><ul><li><td align=”left”> </li></ul><ul><li>< html:password property=”password” </li></ul><ul><li>size=”16”/> </li></ul><ul><li></td> </li></ul><ul><li></tr> </li></ul><ul><li></table></ html:form > </li></ul><ul><li>< html:javascript formName=”logonForm” </li></ul><ul><li>dynamicJavascript=”true” </li></ul><ul><li>staticJavascript=”false”/> </li></ul><ul><li><script language=”Javascript” .../> </li></ul><ul><li></body></ html:html > </li></ul>
  35. 35. Sample Application – Controller Layer <ul><li>No application logic required – Struts does everything for you :-) </li></ul><ul><li>Controller functionality is configured via XML-based files: </li></ul><ul><ul><li>struts-config.xml – Struts controller configuration </li></ul></ul><ul><ul><li>validation.xml – Validator framework configuration </li></ul></ul><ul><ul><li>web.xml – Web application configuration </li></ul></ul>
  36. 36. Sample Application – Struts Configuration (struts-config.xml) <ul><li><struts-config> </li></ul><ul><li><form-beans> </li></ul><ul><li>... </li></ul><ul><li><form-bean name=”logonForm” </li></ul><ul><li>type=” org.apache.struts.action.DynaActionForm ”> </li></ul><ul><li><form-property name=”username” </li></ul><ul><li>type=” java.lang.String ”/> </li></ul><ul><li><form-property name=”password” </li></ul><ul><li>type=” java.lang.String ”/> </li></ul><ul><li></form-bean> </li></ul><ul><li><form-bean name=”registrationForm” </li></ul><ul><li>type=” org.apache.webapp.example.RegistrationForm ”/> </li></ul><ul><li>... </li></ul><ul><li></form-beans> </li></ul>
  37. 37. Sample Application – Struts Configuration (struts-config.xml) <ul><li><global-forwards> </li></ul><ul><li><forward name=”logoff” path=”/logoff.do”/> </li></ul><ul><li><forward name=”logon” path=”/logon.do”/> </li></ul><ul><li><forward name=”registration” </li></ul><ul><li>path=”/registration.jsp”/> </li></ul><ul><li><forward name=”success” </li></ul><ul><li>path=”/mainMenu.jsp”/> </li></ul><ul><li></global-forwards> </li></ul>
  38. 38. Sample Application – Struts Configuration (struts-config.xml) <ul><li><action-mappings> </li></ul><ul><li><action path=” /editRegistration ” </li></ul><ul><li>type=” org.apache.struts.webapp.example.EditRegistrationAction ” </li></ul><ul><li>name=”registrationForm” </li></ul><ul><li>scope=”request” validate=”false”> </li></ul><ul><li><forward name=”success” </li></ul><ul><li>path=”/registration.jsp”/> </li></ul><ul><li></action> </li></ul><ul><li><action path=” /saveRegistration ” </li></ul><ul><li>type=” org.apache.struts.webapp.example.SaveRegistrationAction ” </li></ul><ul><li>name=”registrationForm” </li></ul><ul><li>scope=”request” validate=”true” </li></ul><ul><li>input=”registration”/> </li></ul>
  39. 39. Sample Application – Struts Configuration (struts-config.xml) <ul><li><action path=” /logon ” </li></ul><ul><li>type=” org.apache.struts.webapp.example.LogonAction ” </li></ul><ul><li>input=”request” </li></ul><ul><li>name=”logonForm” </li></ul><ul><li>scope=”request”/> </li></ul><ul><li>... </li></ul><ul><li></action-mappings> </li></ul><ul><li><controller> </li></ul><ul><li><set-property property=”inputForward” </li></ul><ul><li>value=”true”/> </li></ul><ul><li></controller> </li></ul><ul><li><message-resources </li></ul><ul><li>parameter=” org.apache.struts.example.ApplicationResources ”/> </li></ul>
  40. 40. Sample Application – Struts Configuration (struts-config.xml) <ul><li><plug-in className=” org.apache.struts.webapp.example.memory.MemoryDatabasePlugIn ”> </li></ul><ul><li><set-property property=”pathname” </li></ul><ul><li>value=”/WEB-INF/database.xml”/> </li></ul><ul><li></plug-in> </li></ul><ul><li><plug-in className=” org.apache.struts.validator.ValidatorPlugIn ”> </li></ul><ul><li><set-property property=”pathnames” </li></ul><ul><li>value=”/WEB-INF/validator-rules.xml, </li></ul><ul><li>/WEB-INF/validation.xml”/> </li></ul><ul><li></plug-in> </li></ul><ul><li></struts-config> </li></ul>
  41. 41. Sample Application – Struts Configuration (validation.xml) <ul><li><form-validation> </li></ul><ul><li><formset> </li></ul><ul><li><form name=” logonForm ”> </li></ul><ul><li><field property=”username” </li></ul><ul><li>depends=”minlength,...”> </li></ul><ul><li><arg0 key=”prompt.username”/> </li></ul><ul><li><arg1 key=”${var:minlength}” </li></ul><ul><li>name=”minlength” </li></ul><ul><li>resource=”false”/> </li></ul><ul><li><var><var-name>minlength</var-name> </li></ul><ul><li><var-value>3</var-value></var> </li></ul><ul><li>... </li></ul><ul><li></field> </li></ul><ul><li>... </li></ul><ul><li></form> </li></ul><ul><li>... </li></ul><ul><li></formset> </li></ul><ul><li></form-validation> </li></ul>
  42. 42. Sample Application – Webapp Configuration (web.xml) <ul><li><web-app> </li></ul><ul><li><servlet> </li></ul><ul><li><servlet-name>Controller</servlet-name> </li></ul><ul><li><servlet-class> </li></ul><ul><li>org.apache.struts.action.ActionServlet </li></ul><ul><li></servlet-class> </li></ul><ul><li><init-param> </li></ul><ul><li><param-name>config</param-name> </li></ul><ul><li><param-value> </li></ul><ul><li>/WEB-INF/struts-config.xml </li></ul><ul><li></param-value> </li></ul><ul><li></init-param> </li></ul><ul><li><load-on-startup> 1 </load-on-startup> </li></ul><ul><li></servlet> </li></ul>
  43. 43. Sample Application – Webapp Configuration (web.xml) <ul><li><servlet-mapping> </li></ul><ul><li><servlet-name>Controller</servlet-name> </li></ul><ul><li><url-pattern> *.do </url-pattern> </li></ul><ul><li></servlet-mapping> </li></ul><ul><li>... </li></ul><ul><li></web-app> </li></ul>
  44. 44. <ul><ul><li>Current Events </li></ul></ul>
  45. 45. Struts 1.1 Release <ul><li>When? “Real Soon Now” </li></ul><ul><li>What new features? </li></ul><ul><ul><li>Apache Commons Libraries </li></ul></ul><ul><ul><li>DynaActionForm </li></ul></ul><ul><ul><li>Declarative Exception Handling </li></ul></ul><ul><ul><li>Nested Tag Library </li></ul></ul><ul><ul><li>PlugIn API </li></ul></ul><ul><ul><li>Sub-Application Module Support </li></ul></ul><ul><ul><li>(Contributed) STRUTS-EL Tag Libraries </li></ul></ul>
  46. 46. Struts and JSTL <ul><li>JSP Standard Tag Library (JSTL) 1.0: </li></ul><ul><ul><li>Expression language (“${customer.address[“mailing”].city”) </li></ul></ul><ul><ul><li>General purpose actions (out, set, remove, catch) </li></ul></ul><ul><ul><li>Conditional actions (if, choose, when, otherwise) </li></ul></ul><ul><ul><li>Iterator actions (forEach, forTokens) </li></ul></ul><ul><ul><li>URL actions (import, url, redirect, param) </li></ul></ul><ul><ul><li>Internationalization actions (message, setLocale, bundle, setBundle, message, param, requestEncoding) </li></ul></ul><ul><ul><li>Formatting actions (timeZone, setTimeZone, formatNumber, parseNumber, formatDate, parseDate) </li></ul></ul>
  47. 47. Struts and JSTL <ul><li>JSP Standard Tag Library (JSTL) 1.0, continued: </li></ul><ul><ul><li>SQL actions (not relevant in an MVC framework environment) </li></ul></ul><ul><ul><li>XML core actions (parse, out, set) </li></ul></ul><ul><ul><li>XML flow control actions (if, choose, when, otherwise, forEach) </li></ul></ul><ul><ul><li>XML transform actions (transform, param) </li></ul></ul><ul><li>The struts-xxx-el libraries are a bridge for Struts developers who want to leverage JSTL tags, and expression language syntax, now </li></ul>
  48. 48. Struts and JSF <ul><li>JavaServer Faces (currently under development in JSR-127) </li></ul><ul><li>Goals: </li></ul><ul><ul><li>Standard GUI component framework for web applications </li></ul></ul><ul><ul><li>RenderKits for different rendering environments (browser vs. wireless device, different locales, etc.) </li></ul></ul><ul><li>Struts will provide an integration library: </li></ul><ul><ul><li>Requires changes to view layer and struts-config.xml file only ! </li></ul></ul><ul><ul><li>Plugs in to RequestProcessor APIs </li></ul></ul>
  49. 49. <ul><ul><li>Resources </li></ul></ul>
  50. 50. This Presentation Online <ul><li>StarOffice 6.0: </li></ul><ul><ul><li>http://www.apache.org/~craigmcc/apachecon-2002-struts.sxi </li></ul></ul><ul><li>Powerpoint: </li></ul><ul><ul><li>http://www.apache.org/~craigmcc/apachecon-2002-struts.ppt </li></ul></ul>
  51. 51. Internet Technologies <ul><li>Hypertext Markup Language (HTML) 4.01: </li></ul><ul><ul><li>http://www.w3.org/TR/html4/ </li></ul></ul><ul><li>Hypertext Transfer Protocol (HTTP) 1.1: </li></ul><ul><ul><li>http://www.ietf.org/rfc/rfc2616.txt </li></ul></ul><ul><li>Uniform Resource Identifiers (URI): </li></ul><ul><ul><li>http://www.ietf.org/rfc/rfc2396.txt </li></ul></ul>
  52. 52. Model Layer – Standard Java APIs <ul><li>JavaBeans: </li></ul><ul><ul><li>http://java.sun.com/products/javabeans/ </li></ul></ul><ul><li>Java Database Connectivity (JDBC): </li></ul><ul><ul><li>http://java.sun.com/products/jdbc/ </li></ul></ul><ul><li>Java Data Objects: </li></ul><ul><ul><li>http://java.sun.com/products/jdo/ </li></ul></ul><ul><ul><li>http://jcp.org/jsr/detail/12.jsp </li></ul></ul><ul><li>Java Naming and Directory Interface: </li></ul><ul><ul><li>http://java.sun.com/products/jndi/ </li></ul></ul><ul><li>Enterprise JavaBeans (EJB): </li></ul><ul><ul><li>http://java.sun.com/products/ejb/ </li></ul></ul>
  53. 53. Model Layer – Persistence Frameworks <ul><li>Castor: </li></ul><ul><ul><li>http://castor.exolab.org/ </li></ul></ul><ul><li>Java Data Objects: </li></ul><ul><ul><li>http://java.sun.com/products/jdo/ </li></ul></ul><ul><li>Object/Relational Bridge: </li></ul><ul><ul><li>http://jakarta.apache.org/ojb/ </li></ul></ul><ul><li>Torque: </li></ul><ul><ul><li>http://jakarta.apache.org/turbine/torque/ </li></ul></ul>
  54. 54. View Layer – Standard Java APIs <ul><li>Servlets: </li></ul><ul><ul><li>http://java.sun.com/products/servlet/ </li></ul></ul><ul><li>JavaServer Pages (JSP): </li></ul><ul><ul><li>http://java.sun.com/products/jsp/ </li></ul></ul><ul><li>JSP Standard Tag Library (JSTL): </li></ul><ul><ul><li>http://java.sun.com/products/jsp/jstl/ </li></ul></ul><ul><li>JavaServer Faces: </li></ul><ul><ul><li>http://java.sun.com/j2ee/javaserverfaces/ </li></ul></ul><ul><ul><li>http://jcp.org/jsr/detail/127.jsp </li></ul></ul>
  55. 55. Struts Resources <ul><li>The Struts and Commons Web Sites: </li></ul><ul><ul><li>http://jakarta.apache.org/struts/ </li></ul></ul><ul><ul><li>http://jakarta.apache.org/commons/ </li></ul></ul><ul><li>Recent Books About Struts: </li></ul><ul><ul><li>Cavaness, Chuck; Programming Jakarta Struts ; O'Reilly </li></ul></ul><ul><ul><li>Goodwill, James; Mastering Jakarta Struts ; John Wiley </li></ul></ul><ul><ul><li>Husted, Ted; Java Web Development With Struts ; Manning </li></ul></ul><ul><ul><li>Spielman, Sue; The Struts Framework: Practical Guide for Programmers ; Morgan Kaufman </li></ul></ul><ul><ul><li>Turner, James; Struts Kick Start ; Sams </li></ul></ul>
  56. 56. Design Patterns Resources <ul><li>The Java Blueprints Web Site: </li></ul><ul><ul><li>http://java.sun.com/blueprints/ </li></ul></ul><ul><li>Design Patterns Books: </li></ul><ul><ul><li>Gamma, Erich (et. al.); Design Patterns: Elements of Reusable Object-Oriented Software ; Addison-Wesley </li></ul></ul><ul><ul><li>Alur, Deepak (et. al.); Core J2EE Patterns: Best Practices and Design Strategies ; Prentice Hall </li></ul></ul>
  57. 57. <ul><ul><li>Q & A </li></ul></ul>

×