cvs commit: jakarta-struts/doc/userGuide building_view.xml preface.xml project.xml
husted 2003/11/26 20:06:52 Modified:doc index.xml learning.xml project.xml status.xml using.xml volunteers.xml doc/faqs kickstart.xml newbie.xml project.xml doc/stylesheets struts.xsl doc/userGuide building_view.xml preface.xml project.xml Log: Move resource area to SourceForge site. Revision ChangesPath 1.53 +11 -81jakarta-struts/doc/index.xml Index: index.xml === RCS file: /home/cvs/jakarta-struts/doc/index.xml,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- index.xml 7 Oct 2003 22:26:36 - 1.52 +++ index.xml 27 Nov 2003 04:06:51 - 1.53 @@ -39,15 +39,15 @@ Struts provides its own strongController/strong component and integrates with a href=userGuide/preface.html#layers other technologies/a to provide the Model and the View. -For the strongModel/strong, Struts can interact with standard a href=resources/models.htmldata access -technologies/a, like a href=http://java.sun.com/products/jdbc/;JDBC/a and +For the strongModel/strong, Struts can interact with standard data access +technologies, like a href=http://java.sun.com/products/jdbc/;JDBC/a and a href=http://java.sun.com/products/ejb/;EJB/a, as well as most any third-party packages, like Hibernate, iBATIS, or Object Relational Bridge. For the strongView/strong, Struts works well with a href=http://java.sun.com/products/jsp/;JavaServer Pages/a, including a href=./faqs/kickstart.html#jsfJSTL and JSF/a, as well as Velocity Templates, XSLT, and -a href=resources/views.htmlother presentation systems/a. +other presentation systems. /p p @@ -67,6 +67,14 @@ http://jakarta.apache.org/struts/a. /p +p +Struts is a volunteer project and all support for the framework is provided by unpaid volunteers. +This documentation bundle and the mailing lists are the primary ways to learn how to use Struts. +The next few pages are devoted to helping you understand what resources are available to you. +Since Struts is a volunteer project, and our resources are limited, it is important that we first help you +help yourself. +/p + /section section name=Struts in a Nutshell href=nutshell @@ -157,14 +165,6 @@ Guide/a and the Developer Guides. /p -p -Struts is a volunteer project and all support for the framework is provided by unpaid volunteers. -This documentation bundle and the mailing lists are the primary ways to learn how to use Struts. -The next few pages are devoted to helping you understand what resources are available to you. -Since Struts is a volunteer project, and our resources are limited, it is important that we first help you -help yourself. -/p - /section section name=Is Struts the best choice for every project? @@ -185,76 +185,6 @@ /p /section - -section name=Books about Struts href=books - -div class=center -a href=resources/books.html -img class=book - src=images/books/0471213020.jpg - width=49 - height=60 - alt=/ -/a - -a href=resources/books.html -img class=book - src=images/books/0596003285.jpg - width=49 - height=60 - alt=/ -/a - -a href=resources/books.html -img class=book - src=images/books/0672324725.jpg - width=49 - height=60 - alt=/ -/a - -a href=resources/books.html -img class=book - src=images/books/0971661901.jpg - width=49 - height=60 - alt=/ -/a - -a href=resources/books.html -img class=book - src=images/books/1558608621.jpg - width=49 - height=60 - alt=/ -/a - -a href=resources/books.html -img class=book - src=images/books/1861007817.jpg - width=49 - height=60 - alt=/ -/a - -a href=resources/books.html -img class=book - src=images/books/1930110502.jpg - width=49 - height=60 - alt=/ -/a -/div - - p - The Apache Software Foundation does not provide printed manuals, - but several third-party books about Struts are
cvs commit: jakarta-struts/doc/userGuide building_view.xml
husted 2003/09/02 16:44:08 Modified:doc learning.xml status.xml doc/resources examples.xml index.xml doc/userGuide building_view.xml Log: Routine updates Revision ChangesPath 1.13 +56 -1 jakarta-struts/doc/learning.xml Index: learning.xml === RCS file: /home/cvs/jakarta-struts/doc/learning.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- learning.xml 29 Aug 2003 16:50:08 - 1.12 +++ learning.xml 2 Sep 2003 23:44:08 - 1.13 @@ -141,8 +141,63 @@ /section -section name=Learning More About Struts href=Docs +section name=Struts by Example href=Examples +p +To help you see how it all fits together, several example applications are bundled with the Struts +distribution: +/p + +ul +li +Blank - A simple template for starting new Struts applications./li +li +Exercise-Taglib - A set of test pages that also demonstrate use of the custom tags./li +li +Documentation - The Struts documentation bundle, as seen on the website./li +li +bMailReader/b - The original Struts example application. Try me first./li +li +Tiles-Doc - Extensive demonstration of Tiles extension./li +li +Upload - Demonstrates using the file upload facilities. (Based on Commons Upload.)/li +li +Validator - Demonstrate using the Validator extension./li +/ul + +p +These applications provided as standalone WARs in the binary distribution. +The source code for each application is available under codeWEB-INF/src/code in the binaries and under the +codeweb/code package in the source distribution. +/p + +p +There are also many third-party example applications available for study, including these: +/p + +ul +li +a href=http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuse;AppFuse/a - Demonstrates using XDoclet with +Struts, along with different security packages and Hibernate for database persistence. +/li +li +a href=http://www.ibatis.com/jpetstore/jpetstore.html;JPetStore/a - A streamlined version of the Java +Petstore application implemented with Struts and iBATIS database layer. +/li +li + a href=http://www.codeczar.com/products/logweb/index.html;LogWeb/a - A Struts webapp for configuring +Log4J at runtime within a servlet container. +/li +/ul + +p +See the a href=resources/examples.htmlResources section/a for a complete listing of freely-available +Struts examples. +/p + +/section + +section name=Learning More About Struts href=More p The Struts a href=using.html#ListsMailing Lists/a are a treasure trove of useful, interactive information. The user list tends to carry a high 1.40 +2 -2 jakarta-struts/doc/status.xml Index: status.xml === RCS file: /home/cvs/jakarta-struts/doc/status.xml,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- status.xml30 Aug 2003 14:59:50 - 1.39 +++ status.xml2 Sep 2003 23:44:08 - 1.40 @@ -359,7 +359,7 @@ section p align=right -Next: a href=news/index.htmlRelease Guidelines/a +Next: a href=releases.htmlRelease Guidelines/a /p /section 1.9 +2 -1 jakarta-struts/doc/resources/examples.xml Index: examples.xml === RCS file: /home/cvs/jakarta-struts/doc/resources/examples.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- examples.xml 30 Aug 2003 14:59:50 - 1.8 +++ examples.xml 2 Sep 2003 23:44:08 - 1.9 @@ -11,7 +11,8 @@ section name=Projects and Examples -pa href=http://www.codeczar.com/products/logweb/index.html;LogWeb/a by Nathan Coast - A Struts webapp for configuring Log4J at runtime within a servlet container./p +pa href=http://www.ibatis.com/jpetstore/jpetstore.html;bJPetStore 3/b/a by Clinton Begin - A new JPetStore has arrived! Version 3 takes the best of the previous implementations and puts them together into one comprehensive example of web application architecture using Struts, Data Access Objects and advanced JDBC (via SQL Maps)../p +pa href=http://www.codeczar.com/products/logweb/index.html;bLogWeb/b/a by Nathan Coast - A Struts webapp for configuring Log4J at runtime within a servlet
cvs commit: jakarta-struts/doc/userGuide building_view.xml
sraeburn2003/07/21 09:32:09 Modified:doc/userGuide building_view.xml Log: Updated User Guide XML to fix bug #21773 Revision ChangesPath 1.31 +1 -1 jakarta-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.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- building_view.xml 24 May 2003 10:43:04 - 1.30 +++ building_view.xml 21 Jul 2003 16:32:09 - 1.31 @@ -705,7 +705,7 @@ Create your /index.jsp homepage file: precode![CDATA[ -h1This is my homepage!lt;/h1 +h1This is my homepage/h1 ]]/code/pre /li - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-struts/doc/userGuide building_view.xml
dgraham 2003/02/26 20:15:23 Modified:doc/userGuide building_view.xml Log: Changed reference to perform method to execute. Revision ChangesPath 1.28 +1 -1 jakarta-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.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- building_view.xml 19 Jan 2003 00:40:41 - 1.27 +++ building_view.xml 27 Feb 2003 04:15:23 - 1.28 @@ -446,7 +446,7 @@ p The codevalidate/code method is called by the controller servlet after the bean properties have been populated, but before the corresponding -action class's codeperform/code method is invoked. +action class's codeexecute/code method is invoked. The codevalidate/code method has the following options: /p - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-struts/doc/userGuide building_view.xml
dgraham 2003/02/26 20:20:42 Modified:doc/userGuide building_view.xml Log: Added note to validator section regarding the converNull servlet parameter and required validations of java.lang.Integer fields. Revision ChangesPath 1.29 +7 -0 jakarta-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.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- building_view.xml 27 Feb 2003 04:15:23 - 1.28 +++ building_view.xml 27 Feb 2003 04:20:42 - 1.29 @@ -539,6 +539,13 @@ /p p +strongNote:/strong If your required form property is one of the Java object representations of +primitive types (ie. java.lang.Integer), you must set the ActionServlet's convertNull init. +parameter to true. Failing to do this will result in the required validation not being performed +on that field because it will default to 0. +/p + +p For more about the Struts Validator, see the a href=./dev_validator.htmlDevelopers Guide/a. /p - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-struts/doc/userGuide building_view.xml
husted 2002/12/28 13:53:15 Modified:doc/userGuide building_view.xml Log: Conform line-ends only. No content changes. Revision ChangesPath 1.24 +969 -674 jakarta-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.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- building_view.xml 27 Dec 2002 11:57:48 - 1.23 +++ building_view.xml 28 Dec 2002 21:53:15 - 1.24 @@ -1,7 +1,11 @@ ?xml version=1.0? document url=./building_view.xml - properties +!-- +// 78 +-- + +properties authorCraig R. McClanahan/author authorMike Schachter/author authorTed Husted/author @@ -10,239 +14,294 @@ authorJames DeVries/author authorDavid Graham/author titleThe Struts User's Guide - Building View Components/title - /properties +/properties - body - chapter name=3. Building View Components href=building_view +body +chapter name=3. Building View Components href=building_view - section name=3.1 Overview href=overview +section name=3.1 Overview href=overview -p -This chapter focuses on the task of building the iView/i components -for use with the Struts framework. Many applications rely on JavaServer Pages -(JSP) technology to create the presentation layer. The Struts distribution -includes a comprehensive JSP tag library that provides support for building -internationalized applications, as well as for interacting with input forms. -Several other topics related to the View components are briefly discussed. - /p +p +This chapter focuses on the task of building the iView/i components +for use with the Struts framework. +Many applications rely on JavaServer Pages (JSP) technology to create the +presentation layer. +The Struts distribution includes a comprehensive JSP tag library that +provides support for building internationalized applications, as well as +for interacting with input forms. +Several other topics related to the View components are briefly discussed. +/p -/section +/section + +section name=3.2 Internationalized Messages href=i18n + +p +A few years ago, application developers could count on having to support +only residents of their own country, who are used to only one (or +sometimes two) languages, and one way to represent numeric quantities like +dates, numbers, and monetary values. +However, the explosion of application development based on web +technologies, as well as the deployment of such applications on the +Internet and other broadly accessible networks, have rendered national +boundaries invisible in many cases. +This has translated (if you will pardon the pun) into a need for +applications to support iinternationalization/i (often called i18n +because 18 is the number of letters in between the i and the n) and +ilocalization/i. +/p + +p +Struts builds upon the standard classes available on the Java platform to +build internationalized and localized applications. +The key concepts to become familiar with are: +/p + +ul + +li +a href=http://java.sun.com/j2se/1.4.1/docs/api/java/util/Locale.html; +bLocale/b/a - The fundamental Java class that supports +internationalization is codeLocale/code. +Each codeLocale/code represents a particular choice of country and +language (plus an optional language variant), and also a set of +formatting assumptions for things like numbers and dates. +/li + +li +a href=http://java.sun.com/j2se/1.4.1/docs/api/java/util/ResourceBundle.html; +bResourceBundle/b/a - The codejava.util.ResourceBundle/code +class provides the fundamental tools for supporting messages in +multiple languages. +See the Javadocs for the codeResourceBundle/code class, and the +information on Internationalization in the documentation bundle for your +JDK release, for more information. +/li + +li +a href=http://java.sun.com/j2se/1.4.1/docs/api/java/util/PropertyResourceBundle.html; +bPropertyResourceBundle/b/a - One of the standard +implementations of codeResourceBundle/code allows you to define +resources using the same name=value syntax used to initialize +properties files. +This is very convenient for preparing resource bundles
cvs commit: jakarta-struts/doc/userGuide building_view.xml
husted 2002/12/27 03:57:48 Modified:doc/userGuide building_view.xml Log: Conform use of pre/code tags. No content changes. Revision ChangesPath 1.23 +49 -35jakarta-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.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- building_view.xml 24 Dec 2002 01:50:07 - 1.22 +++ building_view.xml 27 Dec 2002 11:57:48 - 1.23 @@ -133,10 +133,14 @@ precode![CDATA[ servlet servlet-nameaction/servlet-name - servlet-classorg.apache.struts.action.ActionServlet/servlet-class + servlet-class +org.apache.struts.action.ActionServlet + /servlet-class init-param param-nameapplication/param-name -param-valuecom.mycompany.mypackage.MyResources/param-value +param-value +com.mycompany.mypackage.MyResources +/param-value /init-param !-- ... -- /servlet @@ -366,7 +370,9 @@ %@page language=java %@taglib uri=/WEB-INF/struts-html.tld prefix=html -html:form action=uploadAction.do enctype=multipart/form-data +html:form +action=uploadAction.do +enctype=multipart/form-data Please Input Text: html:text property=myText Please Input The File You Wish to Upload: @@ -559,7 +565,8 @@ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames -value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml/ +value=/WEB-INF/validator-rules.xml, +/WEB-INF/validation.xml/ /plug-in ]]/code/pre /li @@ -691,48 +698,55 @@ /p ol liCreate a /layout/layout.jsp file that contains your app's common look and feel: -pre -lt;html -lt;body -lt;tiles:insert attribute=body/ -lt;/body -lt;/html -/pre +precode![CDATA[ +html +body +tiles:insert attribute=body/ +/body +/html +]]/code/pre /li li Create your /index.jsp homepage file: -pre -lt;h1This is my homepage!lt;/h1 -/pre +precode![CDATA[ +h1This is my homepage!lt;/h1 +]]/code/pre /li liCreate a /WEB-INF/tiles-defs.xml file that looks like this:br/ -pre -lt;tiles-definitions -lt;definition name=layout path=/layout/layout.jsp -lt;put name=body value=/ -lt;/definition -lt;definition name=homepage extends=layout -lt;put name=body value=/index.jsp/ -lt;/definition -lt;tiles-definitions -/pre +precode![CDATA[ +tiles-definitions +definition +name=layout +path=/layout/layout.jsp +put name=body value=/ +/definition +definition name=homepage extends=layout +put +name=body +value=/index.jsp/ +/definition +tiles-definitions +]]/code/pre /li li Setup the TilesPlugin in the struts-config.xml file: -pre -lt;plug-in className=org.apache.struts.tiles.TilesPlugin -lt;set-property property=definitions-config value=/WEB-INF/tiles-defs.xml/ -lt;/plug-in -/pre +precode![CDATA[ +plug-in +className=org.apache.struts.tiles.TilesPlugin +set-property +property=definitions-config +value=/WEB-INF/tiles-defs.xml/ +/plug-in +]]/code/pre /li li Setup an action mapping in struts-config.xml to point to your homepage tile: -pre -lt;action -path=/index -type=org.apache.struts.actions.ForwardAction -parameter=homepage/ -/pre +precode![CDATA[ +action +path=/index +type=org.apache.struts.actions.ForwardAction +parameter=homepage/ +]]/code/pre /li /ol p -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-struts/doc/userGuide building_view.xml
husted 2002/12/22 11:41:19 Modified:doc/userGuide building_view.xml Log: Conform use of pre/code tags; no content changes. Revision ChangesPath 1.20 +124 -125 jakarta-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.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- building_view.xml 17 Dec 2002 07:21:05 - 1.19 +++ building_view.xml 22 Dec 2002 19:41:19 - 1.20 @@ -130,18 +130,17 @@ for the application. In the case described above, it would be codecom.mycompany.mypackage.MyApplication/code. /p -pre -lt;servlet - lt;servlet-nameactionlt;/servlet-name - lt;servlet-classorg.apache.struts.action.ActionServletlt;/servlet-class - lt;init-param -lt;param-nameapplicationlt;/param-name -lt;param-valuecom.mycompany.mypackage.MyResourceslt;/param-value - lt;/init-param - lt;.../ -lt;/servlet -/pre - +precode![CDATA[ +servlet + servlet-nameaction/servlet-name + servlet-classorg.apache.struts.action.ActionServlet/servlet-class + init-param +param-nameapplication/param-name +param-valuecom.mycompany.mypackage.MyResources/param-value + /init-param + !-- ... -- +/servlet +]]/code/pre p The important thing is for the resource bundle to be found on the class path for your application. Another approach is to store @@ -155,12 +154,12 @@ 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 +precode![CDATA[ +!-- Copy any configuration files -- +copy todir=classes +fileset dir=src/conf/ +/copy +]]/code/pre /section section name=3.3 Forms and FormBean Interactions href=form_beans @@ -190,12 +189,10 @@ standard HTML and JSP pages. For example, an input element for a codeusername/code field might look like this (in JSP): /p - -pre -lt;input type=text name=username - value=lt;%= loginBean.getUsername() %gt;/gt; -/pre - +precode![CDATA[ +input type=text name=username + value=%= loginBean.getUsername() / +]]/code/pre p which is difficult to type correctly, confuses HTML developers who are not knowledgeable about programming concepts, and can cause problems with @@ -203,11 +200,9 @@ building forms, based on the Custom Tag Library facility of JSP 1.1. The case above would be rendered like this using Struts: /p - -pre -lt;html:text property=username/gt; -/pre - +precode![CDATA[ +html:text property=username/; +]]/code/pre p with no need to explicitly refer to the JavaBean from which the initial value is retrieved. That is handled automatically by the JSP tag, using @@ -232,57 +227,61 @@ example application included with Struts) named codelogon.jsp/code: /p hr/ -pre -lt;%@ page language=java %gt; -lt;%@ taglib uri=/WEB-INF/struts-html.tld -prefix=html %gt; -lt;%@ taglib uri=/WEB-INF/struts-bean.tld -prefix=bean %gt; -lt;html:htmlgt; -lt;headgt; -lt;titlegt; - lt;bean:message key=logon.title/gt; -lt;/titlegt; -lt;/headgt; -lt;body bgcolor=whitegt; -lt;html:errors/gt; -lt;html:form action=/logon focus=usernamegt; -lt;table border=0 width=100%gt; - lt;trgt; -lt;th align=rightgt; - lt;bean:message key=prompt.username/gt; -lt;/thgt; -lt;td align=leftgt; - lt;html:text property=username - size=16/gt; -lt;/tdgt; - lt;/trgt; - lt;trgt; -lt;th align=rightgt; - lt;bean:message key=prompt.password/gt; -lt;/thgt; -lt;td align=leftgt; - lt;html:password property=password - size=16/gt; -lt;/tdgt; - lt;/trgt; - lt;trgt; -lt;td align=rightgt; - lt;html:submitgt; -lt;bean:message key=button.submit/gt; - lt;/html:submitgt; -lt;/tdgt; -lt;td align=rightgt; - lt;html:resetgt; -lt;bean:message key=button.reset/gt; - lt;/html:resetgt; -lt;/tdgt; - lt;/trgt; -lt;/tablegt; -lt;/html:formgt; -lt;/bodygt; -lt;/html:htmlgt; -/pre +precode![CDATA[ +%@ page language=java % +%@ taglib + uri=/WEB-INF/struts-html.tld + prefix=html % +%@ + taglib uri=/WEB-INF/struts-bean.tld + prefix=bean % +html:html +head +title + bean:message key=logon.title/ +/title +/head +body bgcolor=white +html:errors/ +html:form
cvs commit: jakarta-struts/doc/userGuide building_view.xml
dgraham 2002/12/22 15:10:29 Modified:doc/userGuide building_view.xml Log: Added text for section 3.4.3 Tiles. Revision ChangesPath 1.21 +55 -2 jakarta-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.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- building_view.xml 22 Dec 2002 19:41:19 - 1.20 +++ building_view.xml 22 Dec 2002 23:10:28 - 1.21 @@ -685,10 +685,63 @@ /section section name=3.4.3 Page Composition With Tiles href=Tiles - p -[:TODO:] +Tiles is a powerful templating library that allows you to construct views by combining +various tiles. Here's a quick setup guide: /p + ol + liCreate a /layout/layout.jsp file that contains your app's common look and feel: + pre + lt;html + lt;body + lt;tiles:insert attribute=body/ + lt;/body + lt;/html + /pre + /li + li + Create your /index.jsp homepage file: + pre + lt;h1This is my homepage!lt;/h1 + /pre + /li + liCreate a /WEB-INF/tiles-defs.xml file that looks like this:br/ + pre + lt;tiles-definitions + lt;definition name=layout path=/layout/layout.jsp + lt;put name=body value=/ + lt;/definition + lt;definition name=homepage extends=layout + lt;put name=body value=/index.jsp/ + lt;/definition + lt;tiles-definitions + /pre + /li + li + Setup the TilesPlugin in the struts-config.xml file: + pre + lt;plug-in className=org.apache.struts.tiles.TilesPlugin + lt;set-property property=definitions-config value=/WEB-INF/tiles-defs.xml/ + lt;/plug-in + /pre + /li + li + Setup an action mapping in struts-config.xml to point to your homepage tile: + pre + lt;action + path=/index + type=org.apache.struts.actions.ForwardAction + parameter=homepage/ + /pre + /li +/ol +p + The TilesPlugin configures a special RequestProcessor that determines if the requested view is a + tile and processes it accordingly. Note that we made the homepage tile extend our root layout + tile and changed the body attribute. Tiles inserts the file named in the body attribute into the main + layout. +/p +pSee the the tiles-documentation webapp for in-depth examples./p /section section name=3.4.4 Image Rendering Components href=image_rendering -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-struts/doc/userGuide building_view.xml
dgraham 2002/12/16 23:21:05 Modified:doc/userGuide building_view.xml Log: Filled in Validator section 3.3.5 with basic setup instructions. Revision ChangesPath 1.19 +29 -1 jakarta-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.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- building_view.xml 30 Nov 2002 22:25:16 - 1.18 +++ building_view.xml 17 Dec 2002 07:21:05 - 1.19 @@ -536,7 +536,35 @@ /section section name=3.3.5 The Struts Validator href=validator -p[:TODO:]/p +p +Configuring the Validator to perform form validation is easy.br/ +ol + liThe ActionForm bean must extend ValidatorForm/li + liThe form's JSP must include the a href=struts-html.htmllt;html:javascriptgt;/a tag for client side validation./li + liYou must define the validation rules in an xml file like this:br/ +pre + lt;form-validation + lt;formset + lt;form name=logonForm + lt;field property=username depends=required + lt;msg name=required key=error.username/ + lt;/field + lt;/form + lt;/formset + lt;/form-validation +/pre +br/ +The msg element points to the message resource key to use when generating the error message. +/li +liLastly, you must enable the ValidatorPlugin in the struts-config.xml file like this:br/ + pre +lt;plug-in className=org.apache.struts.validator.ValidatorPlugIn + lt;set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml/ + lt;/plug-in + /pre +/li +/ol +/p /section section name=3.3.6 Indexed amp; Mapped Properties href=indexed -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-struts/doc/userGuide building_view.xml index.xml
dmkarr 2002/11/30 14:25:17 Modified:doc/faqs index.xml doc/userGuide building_view.xml index.xml Added: doc/faqs indexedprops.xml Log: Added detailed FAQ on indexed mapped properties, and indexed tags. Added short section to user guide mentioning indexed/mapped properties, providing link to new FAQ. I'd appreciate it if people familiar with this area would review this documentation. Revision ChangesPath 1.5 +1 -0 jakarta-struts/doc/faqs/index.xml Index: index.xml === RCS file: /home/cvs/jakarta-struts/doc/faqs/index.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- index.xml 29 Nov 2002 21:24:49 - 1.4 +++ index.xml 30 Nov 2002 22:25:16 - 1.5 @@ -22,6 +22,7 @@ lia href=ssl.htmlUsing the SSL protocol/a/li lia href=eclipse.htmlInstalling the Eclipse IDE/a/li lia href=netbeans.htmlInstalling the Netbeans IDE/a/li +lia href=indexedprops.htmlIndexed Properties, Mapped Properties, and Indexed Tags/a/li /ul /section 1.1 jakarta-struts/doc/faqs/indexedprops.xml Index: indexedprops.xml === ?xml version=1.0? document url=./indexedprops.xml properties authorDavid M. Karr/author titleIndexed Properties, Mapped Properties, and Indexed Tags/title /properties body chapter href=indexedprops name=Indexed Properties, Mapped Properties, and Indexed Tags section href=introduction name=Introduction p The JSP specification discusses using indexed properties in reference to the lt;jsp:setPropertygt; tag. However, none of the support provided in the base JSP specification actually deals with the indexing part. In truth, it allows for setting array properties, but it doesn't do much for setting or even getting the actual values in each entry of the array, except in explicit scriptlet expressions (which are always allowed, but not recommended). /p p The Struts framework provides much more powerful features related to indexed properties, but in truth most of the heavy lifting is not even in the Struts framework, but in the Jakarta Commons Beanutils package. This package is used by Struts to provide this functionality. You can see the javadoc documentation for the Beanutils package at a href=http://jakarta.apache.org/commons/beanutils/api/index.html;http://jakarta.apache.org/commons/beanutils/api/index.html/a. The information particularly related to indexed properties is in the package description for the org.apache.commons.beanutils package. This article mirrors that information, but focuses on how this functionality is mapped to JSP tags using the Struts tag library. /p p The support for indexed properties also includes mapped properties, nested properties and indexed tags, which are all related but slightly different. The latter is exclusive to Struts, but the first two are also provided by the Beanutils package. This article will cover all three of these topics. /p /section section href=indexedprops name=Indexed Properties p The simplest demonstration of using indexed properties in Struts can be shown with the following simple bean and JSP page: /p pre package org.apache.struts.webapp.exercise; import org.apache.struts.action.ActionForm; public class StringBean extends ActionForm { private String strAry[] = { String 0, String 1, String 2, String 3, String 4 }; public String getStringIndexed(int index) { return (strAry[index]); } public void setStringIndexed(int index, String value) { strAry[index] = value; } }/pre p First note the two methods in the StringBean class, getStringIndexed() and setStringIndexed(). Note that the get method takes an int and the set method takes an int and String. The Beanutils package and Struts recognizes this arrangement of signatures as an indexed property, in this case with the property name stringIndexed. /p pre lt;!-- indexedtest.jsp --gt; lt;%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %gt; lt;jsp:useBean id=bean class=org.apache.struts.webapp.exercise.StringBean/gt; lt;bean:write name=bean property=stringIndexed[1]/gt;/pre p Note the property value of stringIndexed[1]. This is intended to reference the indexed property stringIndexed, and the 1st (zero-based) entry of whatever array or collection which the indexed property represents. /p p As you might be able to guess, when this page is executed, it will print
cvs commit: jakarta-struts/doc/userGuide building_view.xml preface.xml
dmkarr 2002/11/01 21:40:18 Modified:doc/userGuide building_view.xml preface.xml Log: I added a short paragraph about Struts-EL to section 0.8, and a longer section as section 3.4.6 in the Building View Components chapter. PR: 14166 Revision ChangesPath 1.17 +50 -4 jakarta-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.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- building_view.xml 29 Oct 2002 04:17:34 - 1.16 +++ building_view.xml 2 Nov 2002 05:40:18 - 1.17 -678,6 +678,56 return(null); /pre + /section + + section name=3.4.6 The Struts-EL Tag Library href=struts-el +p + The strongStruts-EL/strong tag library is a contributed library in + the Struts distribution. It represents an integration of the Struts + tag library with the JavaServer Pages Standard Tag Library, or at + least the expression evaluation engine that is used by the JSTL. +/p +p + The base Struts tag library contains tags which rely on the evaluation + of rtexprvalues (runtime scriptlet expressions) to evaluate dynamic + attribute values. For instance, to print a message from a properties + file based on a resource key, you would use the + codebean:write/code tag, perhaps like this: + pre + lt;bean:message key='lt;%= stringvar %gt;'/gt;/pre +/p +p + This assumes that codestringvar/code exists as a JSP scripting + variable. If you're using the strongStruts-EL/strong library, the + reference looks very similar, but slightly different, like this: + pre + lt;bean-el:message key=${stringvar}/gt;lt;/pregt;/pre +/p +p + If you want to know how to properly use the strongStruts-EL/strong + tag library, there are two important things you need to know: + ul + liThe Struts tag library/li + liThe JavaServer Pages Standard tag library/li + /ul +/p +p + Once you understand how to use these two, consider Struts tag + attribute values being evaluated the same way the JSTL tag attribute + values are. Past that, there is very little else you need to know to + effectively use the strongStruts-EL/strong tag library. +/p +p + Although the strongStruts-EL/strong tag library is a direct port + of the tags from the Struts tag library, not all of the tags in the + Struts tag library were implemented in the strongStruts-EL/strong + tag library. This was the case if it was clear that the functionality + of a particular Struts tag could be entirely fulfilled by a tag in the + JSTL. It is assumed that developers will want to use the + strongStruts-EL/strong tag library along with the JSTL, so it is + reasonable to assume that they will use tags from the JSTL if they + fill their needs. +/p p align=center Next: a href=building_controller.htmlBuilding Controller Components/a /p -686,7 +736,3 /chapter /body /document - - - - 1.11 +12 -2 jakarta-struts/doc/userGuide/preface.xml Index: preface.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/preface.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- preface.xml 29 Oct 2002 05:32:26 - 1.10 +++ preface.xml 2 Nov 2002 05:40:18 - 1.11 -541,10 +541,20 in the Java Web Services Tutorial./p pStruts also works well with the new -a href=http://java.sun.com/products/jsp/jstl;Java Standard Tag Library/a +a href=http://java.sun.com/products/jsp/jstl;JavaServer Pages Standard Tag Library/a and taglibs from other sources, like a href=http://jsptags.com/;JSP Tags/a and -a href=http://jakarta.apache.org/taglibs/index.html;Jarkata Taglibs/a. +a href=http://jakarta.apache.org/taglibs/index.html;Jakarta Taglibs/a. +/p + +p + One of the contributed libraries that comes with the Struts distribution, + called strongStruts-EL/strong, is specifically designed to work well + with the JavaServer Pages Standard Tag Library. In particular, it uses + the same expression language engine for evaluating tag attribute values + as the JSTL. This is in contrast to the main Struts tag library, which + can only use rtexprvalues (runtime
cvs commit: jakarta-struts/doc/userGuide building_view.xml
jmitchell2002/10/28 20:17:34 Modified:doc/userGuide building_view.xml Log: Fixed bad links to userGuide from API docs. Thanks Alan. Revision ChangesPath 1.16 +2 -2 jakarta-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.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- building_view.xml 13 Oct 2002 15:55:12 - 1.15 +++ building_view.xml 29 Oct 2002 04:17:34 - 1.16 -478,7 +478,7 with the ability to dynamically modify the URLs specified by the src and lowsrc attributes in the same manner that lt;html:link can. /li - li[bean] a href=../struts-bean.html#parameterparameter/a retrieves the value of the + li[bean] a href=../userGuide/struts-bean.html#parameterparameter/a retrieves the value of the specified request parameter, and defines the result as a page scope attribute of type String or String[]./li /ul -627,7 +627,7 can conditionally perform the include by nesting it within a tag like a href=../struts-logic.html#equalsequals/a by using it's parameter attribute./li - liThe a href=../struts-bean.html#includebean:include/a tag takes either a + liThe a href=../userGuide/struts-bean.html#includebean:include/a tag takes either a an argument forward representing a logical name mapped to the jsp to include, or the id argument, which represents a page context String variable to print out to the jsp page./li -- 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 building_view.xml
jholmes 2002/06/23 10:55:55 Modified:doc/userGuide building_view.xml Log: update references to new resources pages PR: Bugzilla #9920 Revision ChangesPath 1.11 +1 -1 jakarta-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.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- building_view.xml 9 Jun 2002 22:23:25 - 1.10 +++ building_view.xml 23 Jun 2002 17:55:55 - 1.11 @@ -165,7 +165,7 @@ view neutral. Struts can be used with Velocity Templates, XLST, and any other presentation technology that can be rendered via a Java servlet. See the -a href=../resources.html +a href=../resources/index.html Resources page/a for links to additional information. /blockquote -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-struts/doc/userGuide building_view.xml
craigmcc02/03/11 20:45:22 Modified:doc/userGuide building_view.xml Log: Add missing /head element to example page. PR: Bugzilla #6733 Submitted by: Bryan Field-Elliot bryan at netmeme.org Revision ChangesPath 1.9 +1 -0 jakarta-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.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- building_view.xml 20 Feb 2002 00:41:14 - 1.8 +++ building_view.xml 12 Mar 2002 04:45:22 - 1.9 @@ -236,6 +236,7 @@ lt;titlegt; lt;bean:message key=logon.title/gt; lt;/titlegt; +lt;/headgt; lt;body bgcolor=whitegt; lt;html:errors/gt; lt;html:form action=/logon focus=usernamegt; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-struts/doc/userGuide building_view.xml
craigmcc02/03/11 20:45:59 Modified:doc/userGuide Tag: STRUTS_1_0_BRANCH building_view.xml Log: Port addition of missing /head element. PR: Bugzilla #6733 Submitted by: Bryan Field-Elliot bryan at netmeme.org Revision ChangesPath No revision No revision 1.1.2.6 +2 -1 jakarta-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.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- building_view.xml 21 Nov 2001 16:12:18 - 1.1.2.5 +++ building_view.xml 12 Mar 2002 04:45:59 - 1.1.2.6 @@ -224,6 +224,7 @@ lt;titlegt; lt;bean:message key=logon.title/gt; lt;/titlegt; +lt;/headgt; lt;body bgcolor=whitegt; lt;html:errors/gt; lt;html:form action=/logon focus=usernamegt; @@ -656,4 +657,4 @@ /chapter /body -/document \ No newline at end of file +/document -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-struts/doc/userGuide building_view.xml
martinc 02/01/12 13:38:16 Modified:doc/userGuide building_view.xml Log: Corrected sample code. PR: 5562, 5771 Submitted by: Jonathan Aquino, Aaron Suedmeyer (respectively) Revision ChangesPath 1.7 +3 -3 jakarta-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.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- building_view.xml 4 Nov 2001 03:07:34 - 1.6 +++ building_view.xml 12 Jan 2002 21:38:16 - 1.7 @@ -230,7 +230,7 @@ lt;table border=0 width=100%gt; lt;trgt; lt;th align=rightgt; - lt;html:message key=prompt.username/gt; + lt;bean:message key=prompt.username/gt; lt;/thgt; lt;td align=leftgt; lt;html:text property=username @@ -239,7 +239,7 @@ lt;/trgt; lt;trgt; lt;th align=rightgt; - lt;html:message key=prompt.password/gt; + lt;bean:message key=prompt.password/gt; lt;/thgt; lt;td align=leftgt; lt;html:password property=password @@ -340,7 +340,7 @@ lt;%@page language=java lt;%@taglib uri=/WEB-INF/struts-html.tld prefix=html -lt;html:form action=uploadAction.do +lt;html:form action=uploadAction.do enctype=multipart/form-data Please Input Text: lt;html:text property=myTextlt;br/ Please Input The File You Wish to Upload:lt;br/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]