cvs commit: jakarta-struts/doc/userGuide introduction.xml
dgraham 2003/07/01 21:09:16 Modified:doc/userGuide introduction.xml Log: Fixed typo for PR# 21223. Revision ChangesPath 1.17 +1 -1 jakarta-struts/doc/userGuide/introduction.xml Index: introduction.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/introduction.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- introduction.xml 19 Jan 2003 00:40:41 - 1.16 +++ introduction.xml 2 Jul 2003 04:09:16 - 1.17 @@ -236,7 +236,7 @@ p The bModel/b layer in a MVC application is often project-specific. Struts is - designed to makes it easy to access the business-end of your application, + designed to make it easy to access the business-end of your application, but leaves that part of the programming to other products, like a href=http://java.sun.com/products/jdbc/index.html;JDBC/a, a href=http://java.sun.com/products/ejb/index.html;Enterprise Java Beans/a, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-struts/doc/userGuide introduction.xml
jmitchell2002/10/28 21:30:24 Modified:doc/userGuide introduction.xml Log: Update Docs. Revision ChangesPath 1.13 +1 -1 jakarta-struts/doc/userGuide/introduction.xml Index: introduction.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/introduction.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- introduction.xml 28 Jun 2002 20:59:59 - 1.12 +++ introduction.xml 29 Oct 2002 05:30:24 - 1.13 -48,7 +48,7 JSPs could focus on the nasty business of writing HTML. In due course, using JSPs and servlets together became known as a href=http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html;Model 2/a - (meaning using JSPs alone was presumably Model 1). + (meaning, presumably, that using JSPs alone was Model 1). /p p -- To unsubscribe, e-mail: mailto:struts-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org
cvs commit: jakarta-struts/doc/userGuide introduction.xml building_view.xml building_model.xml building_controller.xml
husted 2002/06/24 04:14:44 Modified:doc/userGuide introduction.xml building_view.xml building_model.xml building_controller.xml Log: Various 1.1-orientated changes. Refer to execute method throughout. Refer to Action Mappings configuration file as Struts configuration file. Minor organizational enhancements. Still need to insert material regarding new 1.1 features. Revision ChangesPath 1.11 +139 -136 jakarta-struts/doc/userGuide/introduction.xml Index: introduction.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/introduction.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- introduction.xml 23 Jun 2002 14:06:17 - 1.10 +++ introduction.xml 24 Jun 2002 11:14:44 - 1.11 @@ -25,7 +25,7 @@ ul lia href=http://www.ietf.org/rfc/rfc2616.txt?number=2616;The HTTP Request/Response sequence/a/li - lia href=http://java.sun.com/products/jsp/product.html;Java Servlets/a/li + lia href=http://java.sun.com/products/servlet/;Java Servlets/a/li lia href=http://java.sun.com/products/javabeans/;JavaBeans/a/li lia href=http://java.sun.com/docs/books/tutorial/essential/attributes/properties.html;Properties/a files and a href=http://java.sun.com/docs/books/tutorial/i18n/resbundle/concept.html;ResourceBundles/a/li @@ -34,8 +34,8 @@ lia href=http://www.w3.org/XML/;Extensible Markup Language/a/li /ul - pIf you are not already familiar with these technologies, the best starting point - a href=http://java.sun.com/webservices/docs/1.0/tutorial/index.html;The Java Web Services Tutorial/a + pIf you are not already familiar with these technologies, the best overall starting point is + a href=http://java.sun.com/webservices/docs/1.0/tutorial/index.html;bThe Java Web Services Tutorial/b/a for the Java Web Services Developer Pack. /p @@ -83,9 +83,13 @@ p Of course, there is nothing new under the Sun ... and many have been quick to point out that - JSP's Model 2 follows the classic Model-View-Controller design pattern abstracted from the - venerable Smalltalk Model/View/Controller framework. It is now commonplace to use the terms - Model 2 and MVC interchangeably. + JSP's Model 2 follows the classic + a href=http://java.sun.com/blueprints/patterns/j2ee_patterns/model_view_controller/;Model-View-Controller/a + design pattern abstracted from the venerable + a href=http://st-www.cs.uiuc.edu/users/smarch/st-docs/mvc.html;Smalltalk MVC framework/a. + Java Web developers now tend to use the terms Model 2 and MVC interchangeably. In this guide, we use + the MVC paradigm to describe the Struts architechture, which might be best termed a Model 2/MVC + design. /p p @@ -115,8 +119,132 @@ /section +section name=1.2.1 The Model: System State and Business Logic JavaBeans href=modelConcepts + + p +The iModel/i portion of an MVC-based system can be often be divided into +two major subsystems -- the binternal state/b of the system +and the bactions/b that can be taken to change that state. + /p + + pIn grammatical terms, we might think about +state information as bnouns/b (things) and actions as bverbs/b +(changes to the state of those things). + /p + + p +Many applications represent the internal state of the +system as a set of one or more JavaBeans. The bean properties represent +the details of the system' state. Depending on your application's complexity, +these beans may be self contained (and know how to persist their own state), +or they may be facades that know how to retrieve the system's state from another +component. This component may be a database, a search engine, an Entity Enterprise +JavaBean, a LDAP server, or something else entirely. + /p + + p +Large-scale applications will often represent the set of possible +business operations as methods that can be called on the bean or beans +maintaining the state information. For example, you might have a shopping +cart bean, stored in session scope for each current user, with properties +that represent the current set of items that the user has decided to +purchase. This bean might also have a codecheckOut()/code method +that authorizes the user's credit card and sends the order to the +warehouse to be picked and shipped. Other systems will represent
cvs commit: jakarta-struts/doc/userGuide introduction.xml
husted 2002/06/23 07:06:17 Modified:doc/userGuide introduction.xml Log: Add some additional hyperlinks, claifications, and enhancements. Revision ChangesPath 1.10 +185 -114 jakarta-struts/doc/userGuide/introduction.xml Index: introduction.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/introduction.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- introduction.xml 9 Jun 2002 22:23:25 - 1.9 +++ introduction.xml 23 Jun 2002 14:06:17 - 1.10 @@ -18,30 +18,30 @@ section name=1.0 Prerequisites p - This User Guide is written for active Web developers, and assumes a working + This User Guide is written for active Web developers and assumes a working knowledge about how Java Web applications work. Before getting started, you should - understand the basics of these core technologies: + understand the basics of several core technologies: /p ul - libThe HTTP Request/Response sequence./bbr/The canonical source for this -is a href=http://www.ietf.org/rfc/rfc2616.txt?number=2616;RFC 2616 -- Hypertext Transfer Protocol (HTTP/1.1)/a./li - libJava Servlets/b.br/ A good place to start is the -a href=http://java.sun.com/products/jsp/product.html;Sun Servlet product page/a -and the a href=http://java.sun.com/docs/books/tutorial/;Sun Java Tutorials/a./li - libJavaServer Pages (JSP)/b.br/ Likewise, a good place to start is the -a href=http://java.sun.com/products/jsp/product.html;Sun JSP product page/a -and the a href=http://java.sun.com/docs/books/tutorial/;Sun Java Tutorials/a./li - libJavaBeans/b.br/Many Struts classes are written as JavaBeans. - If you haven't worked with JavaBeans before, see the - a href=http://java.sun.com/products/javabeans/;Sun JavaBean product page/a -and the a href=http://java.sun.com/docs/books/tutorial/;Sun Java Tutorials/a/li + lia href=http://www.ietf.org/rfc/rfc2616.txt?number=2616;The HTTP Request/Response sequence/a/li + lia href=http://java.sun.com/products/jsp/product.html;Java Servlets/a/li + lia href=http://java.sun.com/products/javabeans/;JavaBeans/a/li + lia href=http://java.sun.com/docs/books/tutorial/essential/attributes/properties.html;Properties/a files and + a href=http://java.sun.com/docs/books/tutorial/i18n/resbundle/concept.html;ResourceBundles/a/li + lia href=http://java.sun.com/products/jsp/product.html;JavaServer Pages (JSP)/a/li. + lia href=http://java.sun.com/products/jsp/taglibraries.html;Custom Tags/a/li + lia href=http://www.w3.org/XML/;Extensible Markup Language/a/li /ul - pIf you've created Web applications on other platforms, you can probably follow along, - and then visit the above references as needed. These are core technologies that - will be used in nearly all Java Web development projects. + pIf you are not already familiar with these technologies, the best starting point + a href=http://java.sun.com/webservices/docs/1.0/tutorial/index.html;The Java Web Services Tutorial/a + for the Java Web Services Developer Pack. + /p + + pIf you've created Web applications on other platforms, you can probably follow along + and then visit the above references as needed. The core technologies used by Struts are + also used by most other Java Web development products. /p /section @@ -55,8 +55,11 @@ /p p - But writing HTML to send to the browser in endless println() statements was tiresome and - problematic. The answer to that was JavaServer Pages, which turned servlet writing inside-out. + But writing HTML to send to the browser in endless codeprintln()/code statements was tiresome and + problematic. The answer to that was + a href=http://java.sun.com/products/jsp/product.html;JavaServer Pages/a, + which turned + a href=http://java.sun.com/products/jsp/product.html;Servlet/a writing inside-out. Now developers could easily mix HTML with Java code, and have all the advantages of servlets. The sky was the limit! /p @@ -73,13 +76,16 @@ Many clever developers realized that JavaServer Pages AND servlets could be used b together/b to deploy web applications. The servlets could help with the control-flow, and the JSPs could focus on the nasty business of writing HTML. In due course, using JSPs and servlets - together became known as Model 2 (where using JSPs alone was Model 1).
cvs commit: jakarta-struts/doc/userGuide introduction.xml installation.xml building_view.xml building_controller.xml
husted 2002/06/09 15:23:25 Modified:doc/userGuide introduction.xml installation.xml building_view.xml building_controller.xml Log: Routine updates to documentation, including patches submitted by James DeVries [Bug 8664], Michael K [Bug 8758], and Dominique Plante [Bug 9641]. Revision ChangesPath 1.9 +38 -21jakarta-struts/doc/userGuide/introduction.xml Index: introduction.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/introduction.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- introduction.xml 4 Nov 2001 03:07:34 - 1.8 +++ introduction.xml 9 Jun 2002 22:23:25 - 1.9 @@ -8,6 +8,7 @@ authorTed Husted/author authorMartin Cooper/author authorEd Burns/author +authorDominique Plante/author titleThe Struts User's Guide - Introduction/title /properties @@ -113,9 +114,17 @@ p True to the Model-View-Controller design pattern, Struts applications have three - major components: a servlet controller, which is provided by Struts itself, - JSP pages (the view), and the application's business logic (or the - model). Let's step through how this all fits together. + major components: +/p + +ul +lia servlet controller, which is provided by Struts itself,/li +liJSP pages (the view), and/li +lithe application's business logic (or the model)./li +/ul + +p + Let's step through how this all fits together. /p p @@ -129,16 +138,17 @@ /p p - An ActionMapping will usually specify:/p +An ActionMapping will usually contain a number of properties including:/p ul - liba request path/b (or URI),/li - lithe bobject type/b (Action subclass) to act upon the request, /li - liand other properties as needed. /li + lia brequest path/b (or URI),/li + lithe bobject type/b (Action subclass) to act upon the request, and/li + liother properties as needed. /li /ul -pThe Action object can handle the request and respond - to the client (usually a Web browser), or indicate that control should be forwarded - elsewhere. For example, if a login succeeds, a login action may wish - to forward the request onto the mainMenu. +p + The Action object can handle the request and respond to the client (usually a Web + browser) or indicate that control should be forwarded elsewhere. For example, if + a login succeeds, a login action may wish to forward the request onto the + mainMenu page. /p p @@ -149,14 +159,15 @@ /p p - An Action object can create a shopping cart bean, add an item to the + For example, an Action object can create a shopping cart bean, add an item to the cart, place the bean in the session collection, and then forward control to another mapping. That mapping may use a JavaServer Page to display the contents of the user's cart. Since each client has their own session, they will each also have their own shopping cart. In a Struts application, most of the business logic can be represented using JavaBeans. An Action can call the properties of a JavaBean without knowing how it actually works. This encapsulates the business logic, - so that the Action can focus on error handling and where to forward control./p + so that the Action can focus on error handling and where to forward control. +/p p JavaBeans can also be used to manage input forms. A key problem in designing @@ -177,15 +188,21 @@ p A Struts form bean is declared in the configuration resource, defined in a Java - source file, and linked to an ActionMapping using a common property name. When - a request calls for an Action that uses a form bean, the controller servlet - either retrieves or creates the form bean, and passes it to the Action object. - The Action object can then check the contents of the form bean before its input - form is displayed, and also queue messages to be handled by the form. When - ready, the Action object can return control with a forwarding to its input - form, usually a JSP. The controller can then respond to the HTTP request and - direct the client to the JavaServer Page. + source file, and linked
cvs commit: jakarta-struts/doc/userGuide introduction.xml index.xml building_view.xml building_model.xml building_controller.xml
husted 01/11/03 19:07:34 Modified:doc/userGuide introduction.xml index.xml building_view.xml building_model.xml building_controller.xml Log: Several stylistic changes. Add caution regarding using nested beans with ActionForms. Add section regarding rendering text. Revision ChangesPath 1.8 +1 -1 jakarta-struts/doc/userGuide/introduction.xml Index: introduction.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/introduction.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- introduction.xml 2001/11/03 12:24:25 1.7 +++ introduction.xml 2001/11/04 03:07:34 1.8 @@ -355,7 +355,7 @@ control should be forwarded so that an action method can ask for the Main Menu page (for example), without knowing what the actual name of the corresponding JSP page is. These features greatly assist you in separating -the control logic (what to do) with the view logic (how it's done). +the control logic (what to do) with the view logic (how it's rendered). /p p align=center 1.5 +1 -0 jakarta-struts/doc/userGuide/index.xml Index: index.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/index.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- index.xml 2001/10/05 11:19:29 1.4 +++ index.xml 2001/11/04 03:07:34 1.5 @@ -50,6 +50,7 @@ lia href=building_view.html#custom_tags3.4.1 Application-Specific Custom Tags/a/li lia href=building_view.html#includes3.4.2 Page Composition With Includes/a/li lia href=building_view.html#image_rendering3.4.3 Image Rendering Components/a/li +lia href=building_view.html#text_rendering3.4.4 Rendering Text/a/li /ul/li /ul/li lia href=building_controller.html4. Building Controller Components/a 1.6 +59 -21jakarta-struts/doc/userGuide/building_view.xml Index: building_view.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/building_view.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- building_view.xml 2001/10/19 05:51:09 1.5 +++ building_view.xml 2001/11/04 03:07:34 1.6 @@ -80,10 +80,11 @@ /ul p -Please note that the i18n support in Struts is currently limited to the -bpresentation/b of internationalized information to the user. -Support for various Locale specific binput methods/b is left up -to the client device, which is usually a web browser. +Please note that the i18n support in a framework like Struts is limited to the +bpresentation/b of internationalized text and images to the user. +Support for Locale specific binput methods/b (used with languages +such as Japanese, Chinese, and Korean) is left up to the client device, which +is usually a web browser. /p p @@ -138,13 +139,24 @@ The important thing is for the resource bundle to be found on the class path for your application. Another approach is to store the codeMyResources.properties/code file in your application's -class folder. You can then simply specify myResources as the -application value. +codeclasses/code folder. You can then simply specify myResources as the +application value. Just be careful it is not deleted if your +build script deletes classes as part of a clean target. /p + p +If it does, here is an Ant task to run when compiling your application +that copies the contents of a codesrc/conf/code +directory to the codeclasses/code directory: + /p + pre +lt;!-- Copy any configuration files -- +lt;copy todir=classes +lt;fileset dir=src/conf/ +lt;/copy + /pre /section -section name=3.3 Forms and FormBean Interactions href=form_beans - +section name=3.3 Forms and FormBean Interactions href=form_beans p At one time or another, most web developers have built forms using the standard capabilities of HTML, such as the codelt;inputgt;/code @@ -189,8 +201,9 @@ files. Struts handles these multipart forms in a way identical to building normal forms. In the next section, we will cover using Struts to create a simple login form, and also a simple mulitpart form. - /p - + /p
cvs commit: jakarta-struts/doc/userGuide introduction.xml
martinc 01/10/18 22:15:16 Modified:doc/userGuide introduction.xml Log: Fix line ends, in preparation for other changes. Revision ChangesPath 1.5 +311 -311 jakarta-struts/doc/userGuide/introduction.xml Index: introduction.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/introduction.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- introduction.xml 2001/10/07 04:48:08 1.4 +++ introduction.xml 2001/10/19 05:15:16 1.5 @@ -1,311 +1,311 @@ -?xml version=1.0? -document url=./introduction.xml - - properties -authorCraig R. McClanahan/author -authorMike Schachter/author -authorLarry McCay/author -authorTed Husted/author -titleThe Struts User's Guide - Introduction/title - /properties - - body - - chapter name=1. Introduction href=introduction - - section name=1.1 Preface: Forward into the Past! (or a brief history of Struts) href=preface - -p - When Java servlets were first invented, many programmers quickly realized that they were a - Good Thing. They were faster and more powerful that standard CGI, portable, and infinitely - extensible. -/p - -p - But writing HTML to send to the browser in endless println() statements was tiresome and - problematic. The answer to that was JavaServer Pages, which turned servlet writing inside-out. - Now developers could easily mix HTML with Java code, and have all the advantages of servlets. - The sky was the limit! -/p - -p - Java web applications quickly became JSP-centric. This in-and-of itself was not a Bad - Thing, but it did little to resolve flow control issues and other problems endemic to web - applications. -/p - -pAnother model was clearly needed .../p - -p - Many clever developers realized that JavaServer Pages AND servlets could be used b - together/b to deploy web applications. The servlets could help with the control-flow, and the - JSPs could focus on the nasty business of writing HTML. In due course, using JSPs and servlets - together became known as Model 2 (where using JSPs alone was Model 1). -/p - -p - Of course, there is nothing new under the Sun ... and many have been quick to point out that - JSP's Model 2 follows SmallTalk's classic Model-View-Controller design pattern. It is now - commonplace to use the terms Model 2 and MVC interchangeably. -/p - -p - The Struts project was launched in May 2000 by Craig R. McClanahan to provide a standard MVC - framework to the Java community. In July 2001, Struts 1.0 was released, and IOHO, Java - Model 2 development will never be quite the same. -/p - - /section - - section name=1.2 The Model-View-Controller ('MVC') Design Pattern href=mvc - -p - In the MVC design pattern, application flow is mediated by a central Controller. The - Controller delegates requests to an appropriate handler. The handlers are tied to a Model, - which act as an adapter between the request and the Model. The Model represents, or - encapsulates, an application's business logic or state. Control is usually then forwarded - back through the Controller to the appropriate View. The forwarding can be determined by - consulting a set of mappings, usually loaded from a database or configuration file. This - provides a loose coupling between the View and Model, which can make an application - significantly easier to create and maintain. -/p - - /section - - - section name=1.3 Struts Framework Overview href=overview - - p - True to the Model-View-Controller design pattern, Struts applications have three - major components: a servlet controller, JavaServer pages (the view), and the - application's business logic (or the model). Let's step through how this all - fits together./p - p - The controller bundles and routes HTTP requests to other objects in the framework, - including JavaServer Pages. When initialized, the controller parses a configuration - resource file. The configuration resource defines (among other things) the action - mappings for the application. The controller
cvs commit: jakarta-struts/doc/userGuide introduction.xml
martinc 01/07/19 23:20:02 Modified:doc/userGuide Tag: STRUTS_1_0_BRANCH introduction.xml Log: Fixed a typo. PR: 2488 Submitted by: Ted Husted Revision ChangesPath No revision No revision 1.1.2.2 +1 -1 jakarta-struts/doc/userGuide/introduction.xml Index: introduction.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/introduction.xml,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- introduction.xml 2001/07/05 11:47:15 1.1.2.1 +++ introduction.xml 2001/07/20 06:20:01 1.1.2.2 @@ -164,7 +164,7 @@ p For the simplest applications, an action object can handle the business logic associated with a request. However, in most cases, an action object should pass - the request to another object, usually a JavaBean. To allow resuse on other + the request to another object, usually a JavaBean. To allow reuse on other platforms, business-logic JavaBeans should not refer to any Web application objects. The action object should translate needed details from the HTTP request and pass those along to the business-logic beans as regular Java variables.
cvs commit: jakarta-struts/doc/userGuide introduction.xml
martinc 01/07/19 23:22:12 Modified:doc/userGuide introduction.xml Log: Fixed a typo. PR: 2488 Submitted by: Ted Husted Revision ChangesPath 1.3 +1 -1 jakarta-struts/doc/userGuide/introduction.xml Index: introduction.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/introduction.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- introduction.xml 2001/07/05 11:43:17 1.2 +++ introduction.xml 2001/07/20 06:22:11 1.3 @@ -164,7 +164,7 @@ p For the simplest applications, an action object can handle the business logic associated with a request. However, in most cases, an action object should pass - the request to another object, usually a JavaBean. To allow resuse on other + the request to another object, usually a JavaBean. To allow reuse on other platforms, business-logic JavaBeans should not refer to any Web application objects. The action object should translate needed details from the HTTP request and pass those along to the business-logic beans as regular Java variables.