[Struts Wiki] Update of "StrutsBooks" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsBooks -- * [http://www.apress.com/book/bookDisplay.html?bID=10071 Beginning Apache Struts: From Novice to Professional] by Arnold Doray (February 2006) * [http://www.packtpub.com/struts/book Learning Jakarta Struts 1.2: a concise and practical tutorial] by Stephan Wiesner (August 2005) * [http://www.dunod.com/pages/ouvrages/ficheouvrage.asp?id=48635 Struts : les bonnes pratiques pour des développements web réussis] (Français) par Vic Cekvenich, Wolfgang Gehner (Février 2005) - * [http://www.amazon.com/exec/obidos/tg/detail/-/059600771X/apachesoftwar-20/ Jakarta Struts Cookbook] by Bill Siggelkow (February 2005) + * [http://www.amazon.com/exec/obidos/tg/detail/-/059600771X/apachesoftwar-20/ Jakarta Struts Cookbook] by Bill Siggelkow (February 2005) + * [http://www.sourcebeat.com/TitleAction.do?id=3 Jakarta Struts Live] by Richard Hightower (2004). The [http://www.theserverside.com/tt/books/sourcebeat/JakartaStrutsLive/index.tss PDF version] is available for free. - * [http://www.amazon.com/exec/obidos/tg/detail/-/0974848808/apachesoftwar-20/ Struts Survival Guide: Basics to Best Practices] by Srikanth Shenoy, Nithin Mallya (February 2004) The ebook version is now available free [http://www.objectsource.com/Struts_Survival_Guide.pdf here] + * [http://www.amazon.com/exec/obidos/tg/detail/-/0974848808/apachesoftwar-20/ Struts Survival Guide: Basics to Best Practices] by Srikanth Shenoy, Nithin Mallya (February 2004). The [http://www.objectsource.com/Struts_Survival_Guide.pdf PDF version] is available for free. * [http://www.amazon.com/exec/obidos/tg/detail/-/0072231319/apachesoftwar-20/ Struts: The complete reference] by James Holmes (April 2004) * [http://www.amazon.com/exec/obidos/tg/detail/-/0764559575/apachesoftwar-20/ Jakarta Struts for Dummies] by Mike Robinson, Ellen Finkelstein (March 2004) * [http://www.amazon.com/exec/obidos/tg/detail/-/159059228X/apachesoftwar-20/ Pro Jakarta Struts, Second Edition] by John Carnell, Rob Harrop (March 2004) @@ -26, +27 @@ * [http://www.amazon.com/exec/obidos/tg/detail/-/0672324725/ Struts Kick Start] by James Turner, Kevin Bedell (December 2002) * [http://www.amazon.com/exec/obidos/tg/detail/-/0596003285/apachesoftwar-20/ Mastering Jakarta Struts] by James Goodwill (September 2002) * [http://www.amazon.com/exec/obidos/tg/detail/-/1558608621/apachesoftwar-20/ The Struts Framework: Practical Guide for Java Programmers] by Sue Spielman (October 2002) - * [http://www.amazon.com/gp/product/0971661901/104-0581018-0788724?v=glance&n=283155 Struts Fast Track] Practical Application with Database Access and Struts Extension by Vic Cekvenich - Sept. 2001 (1st Struts Book). StrutsBook -- A link to soft copy of the book. + * [http://www.amazon.com/gp/product/0971661901/104-0581018-0788724?v=glance&n=283155 Struts Fast Track] Practical Application with Database Access and Struts Extension by Vic Cekvenich - Sept. 2001 (1st Struts Book). The [:StrutsBook:MSWord version] is available for free. = Books with Struts coverage (by release date, newer first) =
[Struts Wiki] Update of "StrutsTutorials" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsTutorials -- http://www.arc-mind.com/downloads_protected/tutorials/struts/advanced-tiles.pdf -- Master the Struts Tiles Framework Tutorial by !ArcMind. + http://courses.coreservlets.com/Course-Materials/struts.html -- Struts Tutorial and Training Materials by Marty Hall. + StrutsUniversity -- Business presentations regarding Struts and related technologies Take a look at the StrutsArticles page as well.
[Struts Wiki] Update of "PoweredBy" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/PoweredBy -- * http://www.rd.com - Reader's Digest website (as of July 2006) Previous version had been built with MS ASP (according to Netcraft.com). * http://www.bridgerfunding.com - commercial funding company (as of July 2006) * http://www.tirekingdom.com - Tire Kingdom, tire and automotive services retailer in the United States (as of July 2006) + * http://www.irs.gov - Internal Revenue Service, portions of website (as of 2004-2006) See also: * StrutsWebLinks page for the list of third party software built on Struts.
svn commit: r423938 - in /struts/maven/trunk/struts2-archetype-starter/src/main/resources: META-INF/ archetype-resources/src/main/webapp/WEB-INF/decorators/ archetype-resources/src/main/webapp/WEB-INF
Author: tmjee Date: Thu Jul 20 07:07:22 2006 New Revision: 423938 URL: http://svn.apache.org/viewvc?rev=423938&view=rev Log: WW-1367 - moved css styles from /WEB-INF/* to /webapp/* cause browser style tag href can't access /WEB-INF/* Added: struts/maven/trunk/struts2-archetype-starter/src/main/resources/archetype-resources/src/main/webapp/styles/ - copied from r423525, struts/maven/trunk/struts2-archetype-starter/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/styles/ Removed: struts/maven/trunk/struts2-archetype-starter/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/styles/ Modified: struts/maven/trunk/struts2-archetype-starter/src/main/resources/META-INF/archetype.xml struts/maven/trunk/struts2-archetype-starter/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/decorators/main.ftl Modified: struts/maven/trunk/struts2-archetype-starter/src/main/resources/META-INF/archetype.xml URL: http://svn.apache.org/viewvc/struts/maven/trunk/struts2-archetype-starter/src/main/resources/META-INF/archetype.xml?rev=423938&r1=423937&r2=423938&view=diff == --- struts/maven/trunk/struts2-archetype-starter/src/main/resources/META-INF/archetype.xml (original) +++ struts/maven/trunk/struts2-archetype-starter/src/main/resources/META-INF/archetype.xml Thu Jul 20 07:07:22 2006 @@ -19,20 +19,20 @@ src/main/webapp/WEB-INF/decorators/main.ftl src/main/webapp/WEB-INF/applicationContext.xml src/main/webapp/WEB-INF/decorators.xml - src/main/webapp/WEB-INF/styles/main.css - src/main/webapp/WEB-INF/styles/forms.css - src/main/webapp/WEB-INF/styles/layout.css - src/main/webapp/WEB-INF/styles/layout-1col.css - src/main/webapp/WEB-INF/styles/layout-navleft-1col.css - src/main/webapp/WEB-INF/styles/layout-navleft-2col.css - src/main/webapp/WEB-INF/styles/layout-navtop-1col.css - src/main/webapp/WEB-INF/styles/layout-navtop-3col.css - src/main/webapp/WEB-INF/styles/layout-navtop-localleft.css - src/main/webapp/WEB-INF/styles/layout-navtop-subright.css - src/main/webapp/WEB-INF/styles/nav-horizontal.css - src/main/webapp/WEB-INF/styles/nav-vertical.css - src/main/webapp/WEB-INF/styles/tools.css - src/main/webapp/WEB-INF/styles/typo.css + src/main/webapp/styles/main.css + src/main/webapp/styles/forms.css + src/main/webapp/styles/layout.css + src/main/webapp/styles/layout-1col.css + src/main/webapp/styles/layout-navleft-1col.css + src/main/webapp/styles/layout-navleft-2col.css + src/main/webapp/styles/layout-navtop-1col.css + src/main/webapp/styles/layout-navtop-3col.css + src/main/webapp/styles/layout-navtop-localleft.css + src/main/webapp/styles/layout-navtop-subright.css + src/main/webapp/styles/nav-horizontal.css + src/main/webapp/styles/nav-vertical.css + src/main/webapp/styles/tools.css + src/main/webapp/styles/typo.css src/main/webapp/WEB-INF/dwr.xml src/main/webapp/WEB-INF/sitemesh.xml src/main/webapp/WEB-INF/sitemesh-decorator.tld Modified: struts/maven/trunk/struts2-archetype-starter/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/decorators/main.ftl URL: http://svn.apache.org/viewvc/struts/maven/trunk/struts2-archetype-starter/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/decorators/main.ftl?rev=423938&r1=423937&r2=423938&view=diff == --- struts/maven/trunk/struts2-archetype-starter/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/decorators/main.ftl (original) +++ struts/maven/trunk/struts2-archetype-starter/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/decorators/main.ftl Thu Jul 20 07:07:22 2006 @@ -5,7 +5,7 @@ http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"> ${title} - +
[Struts Wiki] Update of "StateManagement" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StateManagement -- Implications: Application must provide explicit navigational links and buttons so users would not have to use standard browser navigation buttons. Application must recognize and handle double-submit situations. How Struts can help: - * Use [http://struts.apache.org/1.x/struts-taglib/tlddoc/html/hidden.html tag] to store hidden field information and to submit it to location specified in tag. + * Use [http://struts.apache.org/1.x/struts-taglib/tlddoc/html/form.html tag] to display data entry form, and a single [:StrutsFormBeans: ActionForm] to handle both render and submit phases of request/response cycle. On render phase Struts renders HTML form fields using values from an !ActionForm. On submit phase Struts automatically populates !ActionForm properties with values of HTML form fields. This setup ensures that content of form fields is saved and redisplayed automatically. Automatic saving/restoring of HTML form fields is similar to handling ''postback controls'' in ASP.NET. Struts does not have notion of ''non-postback controls'' like labels or data grids, and does not automatically save such information. + * Use [http://struts.apache.org/1.x/struts-taglib/tlddoc/html/hidden.html tag] to store stringified data in an HTML form and to submit it to location specified in tag. Struts does not provide built-in functionality to encrypt hidden fields. * Use [http://struts.apache.org/1.2.9/api/org/apache/struts/util/TokenProcessor.html TokenProcessor class] to distinguish resubmits. = Server-Side Techniques =
svn commit: r423995 [2/2] - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java?rev=423995&r1=423994&r2=423995&view=diff == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java Thu Jul 20 10:23:12 2006 @@ -18,7 +18,6 @@ package org.apache.struts2.views.xslt; import org.apache.struts2.ServletActionContext; -import org.apache.struts2.StrutsConstants; import org.apache.struts2.config.Configuration; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; @@ -39,7 +38,6 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; -import java.util.regex.Pattern; /** @@ -181,131 +179,146 @@ */ public class XSLTResult implements Result { - private static final long serialVersionUID = 8024698928688847685L; - - private static final Log log = LogFactory.getLog(XSLTResult.class); -public static final String DEFAULT_PARAM = "location"; - -private static final Object LOCK = new Object(); // lock in synchronized code - -protected boolean noCache = false; -protected Map templatesCache; -protected String location; -protected boolean parse; -protected Pattern matchingPattern = null; -protected Pattern excludingPattern = null; +private static final Log log = LogFactory.getLog(XSLTResult.class); +public static final String DEFAULT_PARAM = "stylesheetLocation"; + +protected boolean noCache; +private final Map templatesCache; +private String stylesheetLocation; +private boolean parse; +private AdapterFactory adapterFactory; public XSLTResult() { -templatesCache = new HashMap(); -noCache = Configuration.getString(StrutsConstants.STRUTS_XSLT_NOCACHE).trim().equalsIgnoreCase("true"); +templatesCache = new HashMap(); +noCache = Configuration.getString("struts.xslt.nocache").trim().equalsIgnoreCase("true"); } +/** + * @deprecated Use #setStylesheetLocation(String) + */ public void setLocation(String location) { -this.location = location; +setStylesheetLocation(location); } -public void setMatchingPattern(String matchingPattern) { -this.matchingPattern = Pattern.compile(matchingPattern); +public void setStylesheetLocation(String location) { +if (location == null) +throw new IllegalArgumentException("Null location"); +System.out.println("location = " + location); +this.stylesheetLocation = location; } -public void setExcludingPattern(String excludingPattern) { -this.excludingPattern = Pattern.compile(excludingPattern); +public String getStylesheetLocation() { +return stylesheetLocation; } +/** + * If true, parse the stylesheet location for OGNL expressions. + * + * @param parse + */ public void setParse(boolean parse) { this.parse = parse; } public void execute(ActionInvocation invocation) throws Exception { -long startTime = -1; - -if (log.isDebugEnabled()) { -startTime = System.currentTimeMillis(); -} +long startTime = System.currentTimeMillis(); +String location = getStylesheetLocation(); if (parse) { OgnlValueStack stack = ActionContext.getContext().getValueStack(); location = TextParseUtil.translateVariables(location, stack); } -if (location == null || location.trim().length() == 0) { -String msg = "Location paramter is empty. " + -"Check the tag specified for this action."; -log.error(msg); -throw new IllegalArgumentException(msg); -} - try { HttpServletResponse response = ServletActionContext.getResponse(); Writer writer = response.getWriter(); // Create a transformer for the stylesheet. -Templates templates = getTemplates(location); -Transformer transformer = templates.newTransformer(); - -String mimeType = templates.getOutputProperties().getProperty(OutputKeys.MEDIA_TYPE); - +Templates templates = null; +Transformer transformer; +if (location != null) { +templates = getTemplates(location); +transformer = templates.newTransformer(); +} else +transformer = TransformerFactory.newInstance().newTransformer(); + +transformer.setURIResolver(getURIResolver()); + +String mimeType; +if (templates == null) +mimeType = "
svn commit: r423998 - in /struts/struts2/trunk/core/src/test: java/org/apache/struts2/views/xslt/XSLTResultTest.java resources/XSLTResultTest3.xsl
Author: hermanns Date: Thu Jul 20 10:24:46 2006 New Revision: 423998 URL: http://svn.apache.org/viewvc?rev=423998&view=rev Log: XSLTResult - 3 issues o backport from WW-2.2.3 o fixed stylesheet o reactivated commented test cases Issue number: WW-1255 Obtained from: Submitted by: Reviewed by: Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java struts/struts2/trunk/core/src/test/resources/XSLTResultTest3.xsl Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java?rev=423998&r1=423997&r2=423998&view=diff == --- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java (original) +++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java Thu Jul 20 10:24:46 2006 @@ -69,40 +69,38 @@ } public void testSimpleTransform() throws Exception { -// TODO: XSLTResult does not work with JDK1.5 - -/*result.setParse(false); +result.setParse(false); result.setLocation("XSLTResultTest.xsl"); result.execute(mai); String out = response.getContentAsString(); assertTrue(out.startsWith("")); -assertTrue(out.indexOf("http://www.w3.org/TR/xhtml1/strict\"";) > -1);*/ +assertTrue(out.indexOf("http://www.w3.org/TR/xhtml1/strict\"";) > -1); } public void testSimpleTransformParse() throws Exception { -/*result.setParse(true); +result.setParse(true); result.setLocation("${top.myLocation}"); result.execute(mai); String out = response.getContentAsString(); assertTrue(out.startsWith("")); -assertTrue(out.indexOf("http://www.w3.org/TR/xhtml1/strict\"";) > -1);*/ +assertTrue(out.indexOf("http://www.w3.org/TR/xhtml1/strict\"";) > -1); } public void testTransform2() throws Exception { -/*result.setParse(false); +result.setParse(false); result.setLocation("XSLTResultTest2.xsl"); result.execute(mai); String out = response.getContentAsString(); assertTrue(out.startsWith("")); assertTrue(out.indexOf("http://www.w3.org/TR/xhtml1/strict\"";) > -1); -assertTrue(out.indexOf("Hello Santa Claus how are you?") > -1);*/ +assertTrue(out.indexOf("Hello Santa Claus how are you?") > -1); } public void testTransform3() throws Exception { -/*result.setParse(false); +result.setParse(false); result.setLocation("XSLTResultTest3.xsl"); result.execute(mai); @@ -110,9 +108,8 @@ assertTrue(out.startsWith("")); assertTrue(out.indexOf("http://www.w3.org/TR/xhtml1/strict\"";) > -1); assertTrue(out.indexOf("Hello Santa Claus how are you?") > -1); -assertTrue(out.indexOf("Struts in Action by Patrick and Jason") > -1);*/ -// TODO: There is a bug in XSLTResult and having collections -//assertTrue(out.indexOf("XWork not in Action by Superman") > -1); +assertTrue(out.indexOf("WebWork in Action by Patrick and Jason") > -1); +assertTrue(out.indexOf("XWork not in Action by Superman") > -1); } protected void setUp() throws Exception { @@ -162,7 +159,7 @@ public List getBooks() { List list = new ArrayList(); -list.add(new Book("Struts in Action", "Patrick and Jason")); +list.add(new Book("WebWork in Action", "Patrick and Jason")); list.add(new Book("XWork not in Action", "Superman")); return list; } @@ -187,5 +184,4 @@ return author; } } - } Modified: struts/struts2/trunk/core/src/test/resources/XSLTResultTest3.xsl URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/resources/XSLTResultTest3.xsl?rev=423998&r1=423997&r2=423998&view=diff == --- struts/struts2/trunk/core/src/test/resources/XSLTResultTest3.xsl (original) +++ struts/struts2/trunk/core/src/test/resources/XSLTResultTest3.xsl Thu Jul 20 10:24:46 2006 @@ -1,4 +1,4 @@ - + http://www.w3.org/1999/XSL/Transform"; xmlns="http://www.w3.org/TR/xhtml1/strict";> @@ -9,11 +9,11 @@ Hello how are you? We have the following books: - - by . + + by . - \ No newline at end of file +
[Struts Wiki] Update of "StrutsDocComments" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsDocComments -- * Struts Navigation * StrutsJumpToAnchor -- preselecting an anchor on a page * StrutsBackButton -- how to fight with Back button issues in Struts applications +* StrutsSmartNavigation -- how to retain only the last page state in the browser's history * StrutsWebIslands -- how to use one URL for a series of views and to improve user experience * ServingPdfDocuments
[Struts Wiki] Update of "StrutsSmartNavigation" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsSmartNavigation New page: == ASP.NET Approach To Back Button Problem == Microsoft being both a web framework vendor and a browser vendor, has built in an interesting feature into ASP.NET web framework called !SmartNavigation. When Internet Explorer 5.5 or higher receives a response from an ASP.NET application and SmartNavigation is turned on, the following actions are performed: * The flash caused by navigation is eliminated * The scroll position is persisted when moving from page to page * Element focus is persisted between navigations * Only the last page state in the browser's history is retained According to the Microsoft® .NET Framework Class Library documentation, smart navigation is best used only with ASP.NET pages that require frequent postbacks but have visual content that does not change dramatically on return. There are numerous reports about smart navigation being restrictive and downright [http://weblogs.asp.net/ksamaschke/archive/2003/04/27/6085.aspx buggy]. Microsoft acknowledges that "smart navigation is a feature that must be tested in every particular scenario to be sure the proper behavior is exhibited." Nevertheless, the last bullet in the above feature list is very interesting because it shows a different approach to a dreaded problem of web applications known as "Back button issue". == Controlling browser session history: ASP.NET way == Smart navigation feature of ASP.NET framework prevents each ''postback'' from being saved in the browser history. Normally, every postback to an ASP.NET page causes an entry to be created in the browser's history. This defeats the purpose of the browser's back button because instead of going back to the previous '''page''', users are taken to the previous '''state''' of the current page. Smart navigation prevents this from happening by saving only the latest state of the current page in the browser's history. This approach solves issues with Back button because it eliminates the very possibility to navigate to a stale page. At the same time, it allows to manage application state on client, offloading this task from the server session object. This is a brilliant idea, at least for pre-Ajax era. == Controlling browser session history: Struts way == Struts framework cannot target Internet Explorer 5.5 or higher as the only platform, therefore a hack like SmartNavigation cannot be considered a viable solution. But let this not get you down, there are other solutions that work equally well or better, and do not depend on particular browser vendor. Among these solutions are: * [:StrutsWebIslands: Struts web islands] -- an logical improvement to a well-known Redirect-After-Post pattern. Works in most browsers including ancient ones, does not require Javascript. * [:StrutsManualActionWebComponent: Struts web components] -- a component-based solution, does not require Javascript but uses it if available. Without Javascript incurs full page reload similar to StrutsWebIslands approach. With Javascript enabled a portion of a page is updated in-place, which is faster and does not cause growth of browser session history.
[Struts Wiki] Update of "StrutsDocComments" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsDocComments -- * [:StrutsWidgets:Creating widgets with Struts JSP tag library] * StrutsHtmlOptionsInternationalization * Struts Navigation +* StrutsNavigationBasics -- how Struts implements navigation between web resources * StrutsJumpToAnchor -- preselecting an anchor on a page * StrutsBackButton -- how to fight with Back button issues in Struts applications * StrutsSmartNavigation -- how to retain only the last page state in the browser's history
[Struts Wiki] Update of "StrutsNavigationBasics" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsNavigationBasics New page: == Navigation Between Pages == A typical web application is a collection of web resources linked with each other. When using Struts, every web resource is represented with one or more action classes and form beans. When web resource is asked to render itself, a corresponding action class selects a view that reflects current state of the web resource, and sends it to the browser. Struts approach is different from page-oriented framewors like ASP.NET, where a user requests a page, and web server displays that page. In ASP.NET web resource is equal to web page, while in Struts one web resource can have several corresponding web pages. == Round Trip And Postback == When a user interacts with a web resource, the browser may respond to some of the user actions by executing client-side scripts while some other actions that require server resources must be sent for processing to the web server. When server-side processing is involved, a typical interactive user session consists of the following steps: 1. The user requests a web resource from the web server. 2. Struts selects an action class that handles requests to that web resource. 3. The action class responds back with the page containing an HTML form. 4. The user enters the data into HTML form and submits it to the web server. 5. The action class processes the request, and sends the result back to the user. The above interaction can be processed either with two different action classes or with one action class. If two different action classes are involved, then the action class that renders a page is called ''render action'', while the class that processes submitted data is called ''submit action''. If only one action class and one action form are used for both render and submit phases, then step 4 can also be referred to as a ''postback'', because input data is posted back to the same action that displayed the page. Steps 4 and 5 are collectively referred to as a ''round trip''. This model of execution allows a Web server to support a large number of clients because each client request occupies the server resources only for a short duration.
[Struts Wiki] Update of "StrutsNavigationBasics" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsNavigationBasics -- == Navigation Between Pages == - A typical web application is a collection of web resources linked with each other. When using Struts, every web resource is represented with one or more action classes and form beans. When web resource is asked to render itself, a corresponding action class selects a view that reflects current state of the web resource, and sends it to the browser. + A typical web application is a collection of web resources linked with each other. When using Struts, every web resource is represented with one or more action class/form bean pairs. When web resource is asked to render itself, a corresponding action class selects a view that reflects current state of the web resource, and sends it to the browser. + inline:basic_action_asp.gif + - Struts approach is different from page-oriented framewors like ASP.NET, where a user requests a page, and web server displays that page. In ASP.NET web resource is equal to web page, while in Struts one web resource can have several corresponding web pages. + Struts approach is different from page-oriented framewors like ASP.NET, where a user requests a page and web server displays it. In ASP.NET web resource is equal to web page, while in Struts one web resource can have several corresponding web pages. == Round Trip And Postback ==
[Struts Wiki] Update of "StrutsNavigationBasics" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsNavigationBasics -- - == Navigation Between Pages == + == Web Resources And Navigation == A typical web application is a collection of web resources linked with each other. When using Struts, every web resource is represented with one or more action class/form bean pairs. When web resource is asked to render itself, a corresponding action class selects a view that reflects current state of the web resource, and sends it to the browser. + + Struts approach is different from page-oriented framewors like ASP.NET, where a user requests a page and web server displays it. In ASP.NET web resource is equal to web page, while in Struts one web resource can have several corresponding web pages. inline:basic_action_asp.gif - Struts approach is different from page-oriented framewors like ASP.NET, where a user requests a page and web server displays it. In ASP.NET web resource is equal to web page, while in Struts one web resource can have several corresponding web pages. + Struts allows to separate logical state of a web resource from its visual representation. Struts is agnostic to presentation technology, so a page can be generated using JSP file, Tile definition, Velocity template, XSLT stylesheet or other rendering techniques. + + Example + + Consider the Action that performs a search. The author of this code should not bother neither about how exactly the search criteria is obtained, nor about how the search results are presented. His only job is to say "what happened" after the search took place. + + There are three interesting outcomes: + * No results were found => outcome "none". + * Exactly one result was found => outcome "single". + * More than one result was found => outcome "multiple". + + The search Action should return these three results as three separate logical outcomes. It is up to the application architect to decide to send all three outcomes to the "here's the list of responses" table page. It's also up to the application architect (perhaps later, in response to user feedback) to say "let's do this instead": + + * If there's no results, go to a page that says "sorry, no results were found, please try your search again." + * If there's exactly one response, go to the details page to display the corresponding data. + * If there's more than one response, go to the list page (as per the previous behavior). + + Note that the code of the search action is not affected by this decision. == Round Trip And Postback ==
[Struts Wiki] Update of "StrutsManualActionClasses" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsManualActionClasses -- throws Exception;}}} Since the majority of teams using the framework are focused on building web applications, most projects will only use the "!HttpServletRequest" version. A non-HTTP execute() method has been provided for applications that are not specifically geared towards the HTTP protocol. - - '''Example''' - - Consider the Action that performs a search. The author of this code should not bother neither about how exactly the search criteria is obtained, nor about how the search results are presented. His only job is to say "what happened" after the search took place. - - There are three interesting outcomes: - * No results were found => outcome "none". - * Exactly one result was found => outcome "single". - * More than one result was found => outcome "multiple". - - The search Action should return these three results as three separate logical outcomes. It is up to the application architect to decide to send all three outcomes to the "here's the list of responses" table page. It's also up to the application architect (perhaps later, in response to user feedback) to say "let's do this instead": - - * If there's no results, go to a page that says "sorry, no results were found, please try your search again." - * If there's exactly one response, go to the details page to display the corresponding data. - * If there's more than one response, go to the list page (as per the previous behavior). - - Note that the code of the search action is not affected by this decision. In Struts the outcomes returned by an action are much more stable than the presentation locations. On contrary, in ASP.NET the outcome is simply the page that was requested. == Using Action To Display A Web Page ==
[Struts Wiki] Update of "StrutsNavigationBasics" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsNavigationBasics -- - == Web Resources And Navigation == + == Web Resources And Their Views == - A typical web application is a collection of web resources linked with each other. When using Struts, every web resource is represented with one or more action class/form bean pairs. When web resource is asked to render itself, a corresponding action class selects a view that reflects current state of the web resource, and sends it to the browser. + A typical web application is a collection of ''resources'' linked with each other. In Struts a web resource is represented with one or more pairs of an action class and a form bean. When a user requests a web resource to render itself, a corresponding action class selects an appropriate view and sends it to the browser. - Struts approach is different from page-oriented framewors like ASP.NET, where a user requests a page and web server displays it. In ASP.NET web resource is equal to web page, while in Struts one web resource can have several corresponding web pages. + Struts approach differs from page-oriented framewors like ASP.NET. In ASP.NET a web resource equals to web page, while in Struts one web resource can have several corresponding web pages. inline:basic_action_asp.gif - Struts allows to separate logical state of a web resource from its visual representation. Struts is agnostic to presentation technology, so a page can be generated using JSP file, Tile definition, Velocity template, XSLT stylesheet or other rendering techniques. + Struts provides a clean separation between logical state of a web resource from its visual representation. Struts is agnostic to presentation technology, so a page can be displayed using JSP file, Tile definition, Velocity template, XSLT stylesheet or other rendering techniques. Example @@ -18, +18 @@ * Exactly one result was found => outcome "single". * More than one result was found => outcome "multiple". + It is up to the application architect to decide to render the same resulting page for all outcomes or to render different page for every outcome. The code of the search action is not affected by this decision. - The search Action should return these three results as three separate logical outcomes. It is up to the application architect to decide to send all three outcomes to the "here's the list of responses" table page. It's also up to the application architect (perhaps later, in response to user feedback) to say "let's do this instead": - - * If there's no results, go to a page that says "sorry, no results were found, please try your search again." - * If there's exactly one response, go to the details page to display the corresponding data. - * If there's more than one response, go to the list page (as per the previous behavior). - - Note that the code of the search action is not affected by this decision. == Round Trip And Postback == - When a user interacts with a web resource, the browser may respond to some of the user actions by executing client-side scripts while some other actions that require server resources must be sent for processing to the web server. When server-side processing is involved, a typical interactive user session consists of the following steps: + When a user interacts with a web resource and server-side processing is involved, a typical interaction consists of the following steps: 1. The user requests a web resource from the web server. 2. Struts selects an action class that handles requests to that web resource. @@ -36, +30 @@ 4. The user enters the data into HTML form and submits it to the web server. 5. The action class processes the request, and sends the result back to the user. - The above interaction can be processed either with two different action classes or with one action class. + The above interaction can be handled either with two different action classes or with one action class. If two different action classes are involved, then the action class that renders a page is called ''render action'', while the class that processes submitted data is called ''submit action''. - If only one action class and one action form are used for both render and submit phases, then step 4 can also be referred to as a ''postback'', because input data is posted back to the same action that displayed the page. + If only one action class handles both render and submit phases, then step 4 can also be referred to as a ''postback'', because input data is posted back to the same action that displayed the page. Steps 4 and 5 are collectively referred to as a ''round trip''. - This model of execution
svn commit: r424153 - in /struts/struts2/trunk: apps/showcase/src/main/webapp/images/ core/src/main/resources/META-INF/
Author: husted Date: Thu Jul 20 18:21:13 2006 New Revision: 424153 URL: http://svn.apache.org/viewvc?rev=424153&view=rev Log: ww-1367 Update applications and taglib references for Struts 2 conventions. Added: struts/struts2/trunk/apps/showcase/src/main/webapp/images/struts-power.gif (with props) struts/struts2/trunk/apps/showcase/src/main/webapp/images/struts.gif (with props) struts/struts2/trunk/core/src/main/resources/META-INF/tags.tld - copied unchanged from r424152, struts/struts2/trunk/core/src/main/resources/META-INF/taglib.tld Removed: struts/struts2/trunk/apps/showcase/src/main/webapp/images/logo-small.png struts/struts2/trunk/apps/showcase/src/main/webapp/images/logo.png struts/struts2/trunk/core/src/main/resources/META-INF/taglib.tld Added: struts/struts2/trunk/apps/showcase/src/main/webapp/images/struts-power.gif URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/images/struts-power.gif?rev=424153&view=auto == Binary file - no diff available. Propchange: struts/struts2/trunk/apps/showcase/src/main/webapp/images/struts-power.gif -- svn:mime-type = application/octet-stream Added: struts/struts2/trunk/apps/showcase/src/main/webapp/images/struts.gif URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/images/struts.gif?rev=424153&view=auto == Binary file - no diff available. Propchange: struts/struts2/trunk/apps/showcase/src/main/webapp/images/struts.gif -- svn:mime-type = application/octet-stream
[Struts Wiki] Update of "StrutsNavigationBasics" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsNavigationBasics The comment on the change is: Typos, style -- - == Web Resources And Their Views == + == Web Resources, Actions And Views == + A typical web application is a collection of ''resources'' linked with each other. In Struts web resources are represented with one or more action classes. When a user requests a web resource to render itself, a corresponding action class selects an appropriate view and sends it to the browser. Contrary to page-oriented framewors like ASP.NET where a web resource equals to a web page, in Struts one web resource can have several corresponding web pages. - A typical web application is a collection of ''resources'' linked with each other. In Struts a web resource is represented with one or more pairs of an action class and a form bean. When a user requests a web resource to render itself, a corresponding action class selects an appropriate view and sends it to the browser. - - Struts approach differs from page-oriented framewors like ASP.NET. In ASP.NET a web resource equals to web page, while in Struts one web resource can have several corresponding web pages. inline:basic_action_asp.gif - Struts provides a clean separation between logical state of a web resource from its visual representation. Struts is agnostic to presentation technology, so a page can be displayed using JSP file, Tile definition, Velocity template, XSLT stylesheet or other rendering techniques. + Struts provides a clean separation between logical state of a web resource and its visual representation. Struts is agnostic to presentation technology; the output can be rendered using JSP file, Tile definition, Velocity template, XSLT stylesheet, PDF generator or other techniques. Example Consider the Action that performs a search. The author of this code should not bother neither about how exactly the search criteria is obtained, nor about how the search results are presented. His only job is to say "what happened" after the search took place. - There are three interesting outcomes: + There are three possible outcomes: * No results were found => outcome "none". * Exactly one result was found => outcome "single". * More than one result was found => outcome "multiple". - It is up to the application architect to decide to render the same resulting page for all outcomes or to render different page for every outcome. The code of the search action is not affected by this decision. + It is up to the application architect to decide how to visually represent the search result. He can choose to render one resulting page for all outcomes, or to render a different page for every outcome. The code of the search action is not affected by this decision. == Round Trip And Postback == @@ -32, +30 @@ The above interaction can be handled either with two different action classes or with one action class. - If two different action classes are involved, then the action class that renders a page is called ''render action'', while the class that processes submitted data is called ''submit action''. + If two different action classes are involved, then the action class that renders a page is called a ''render action'', while the class that processes submitted data is called a ''submit action''. - If only one action class handles both render and submit phases, then step 4 can also be referred to as a ''postback'', because input data is posted back to the same action that displayed the page. + If only one action class handles both render and submit phases, then step 4 can also be referred to as a ''postback'', because input data is posted back to the same action that has displayed the page. Steps 4 and 5 are collectively referred to as a ''round trip''. == Navigation Between Web Resources == - In a Struts application an action class selects an appropriate view, so a user cannot navigate to a specific view. What a user can navigate to is a specific action. Control can be transferred from action to action programmatically as well. + In a Struts application a user cannot navigate to a specific view, because viewsa are selected by actions. Instead, a user can navigate to a specific action. Control can be transferred from action to action programmatically as well. === Navigation Via Link === @@ -48, +46 @@ === Navigation Via Postback === - An action may render a page that contains an HTML form. When the form is submitted, the action can analyzed input data and either forward or redirect to another action. This way a user can be transferred to another web resource programmatically. + An action may render a page that co
[Struts Wiki] Update of "StrutsDocComments" by MichaelJouravlev
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification. The following page has been changed by MichaelJouravlev: http://wiki.apache.org/struts/StrutsDocComments -- * [:StrutsTags:Using Struts tags, JSTL tags and JSP scriptlets] * [:StrutsWidgets:Creating widgets with Struts JSP tag library] * StrutsHtmlOptionsInternationalization - * Struts Navigation -* StrutsNavigationBasics -- how Struts implements navigation between web resources -* StrutsJumpToAnchor -- preselecting an anchor on a page -* StrutsBackButton -- how to fight with Back button issues in Struts applications -* StrutsSmartNavigation -- how to retain only the last page state in the browser's history -* StrutsWebIslands -- how to use one URL for a series of views and to improve user experience * ServingPdfDocuments * [:StrutsDocController:Building Controller Components] @@ -70, +64 @@ * RequestProcessor * ComposableRequestProcessor * ... + * Struts Navigation +* StrutsNavigationBasics -- how Struts implements navigation between web resources +* StrutsJumpToAnchor -- preselecting an anchor on a page +* StrutsBackButton -- how to fight with Back button issues in Struts applications +* StrutsSmartNavigation -- how to retain only the last page state in the browser's history +* StrutsWebIslands -- how to use one URL for a series of views and to improve user experience * [:StrutsManualActionClasses:Action Classes] * [:StrutsCatalogPreconditions:Preconditions] * [:StrutsCatalogBaseAction:Use Base Action]