svn commit: r417226 - /struts/action2/trunk/core/src/main/resources/org/apache/struts/action2/static/dojo/struts/widgets/Bind.js
Author: tmjee Date: Mon Jun 26 09:29:43 2006 New Revision: 417226 URL: http://svn.apache.org/viewvc?rev=417226&view=rev Log: - WW-1362 - make topic publish contains the source html id attribute value as the argument Modified: struts/action2/trunk/core/src/main/resources/org/apache/struts/action2/static/dojo/struts/widgets/Bind.js Modified: struts/action2/trunk/core/src/main/resources/org/apache/struts/action2/static/dojo/struts/widgets/Bind.js URL: http://svn.apache.org/viewvc/struts/action2/trunk/core/src/main/resources/org/apache/struts/action2/static/dojo/struts/widgets/Bind.js?rev=417226&r1=417225&r2=417226&view=diff == --- struts/action2/trunk/core/src/main/resources/org/apache/struts/action2/static/dojo/struts/widgets/Bind.js (original) +++ struts/action2/trunk/core/src/main/resources/org/apache/struts/action2/static/dojo/struts/widgets/Bind.js Mon Jun 26 09:29:43 2006 @@ -173,7 +173,8 @@ for (var i=0; i < nt.length; i++) { var topic = trim(nt[i]); dojo.debug('notifying [' + topic + ']'); -dojo.event.topic.publish( topic, "notify" ); +//dojo.event.topic.publish( topic, "notify" ); +dojo.event.topic.publish(topic, self.id); } }
svn commit: r417241 - in /struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources: ./ com/myComp/myApp/
Author: tmjee Date: Mon Jun 26 10:19:55 2006 New Revision: 417241 URL: http://svn.apache.org/viewvc?rev=417241&view=rev Log: WW-1359 - added i18n messages example into generated webapp template Added: struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/HelloWorldAction.properties (with props) struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/IndexAction.properties (with props) struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/package.properties (with props) struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/globalmessages.properties (with props) Modified: struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/struts.properties Added: struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/HelloWorldAction.properties URL: http://svn.apache.org/viewvc/struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/HelloWorldAction.properties?rev=417241&view=auto == --- struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/HelloWorldAction.properties (added) +++ struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/HelloWorldAction.properties Mon Jun 26 10:19:55 2006 @@ -0,0 +1,5 @@ +# +# Here is where I18n messages related to HelloWorldAction goes +# + +some.helloWorldAction.key=Some Hello World Action Message Propchange: struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/HelloWorldAction.properties -- svn:eol-style = native Added: struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/IndexAction.properties URL: http://svn.apache.org/viewvc/struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/IndexAction.properties?rev=417241&view=auto == --- struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/IndexAction.properties (added) +++ struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/IndexAction.properties Mon Jun 26 10:19:55 2006 @@ -0,0 +1,5 @@ +# +# Hwere is where I18n messages related to IndexAction goes +# + +some.indexAction.key=Some Index Action Message Propchange: struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/IndexAction.properties -- svn:eol-style = native Added: struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/package.properties URL: http://svn.apache.org/viewvc/struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/package.properties?rev=417241&view=auto == --- struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/package.properties (added) +++ struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/package.properties Mon Jun 26 10:19:55 2006 @@ -0,0 +1,5 @@ +# +# Here is where I18n messages common/related to com.myComp.myApp goes +# + +some.package.key=Some Package Messages Propchange: struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/com/myComp/myApp/package.properties -- svn:eol-style = native Added: struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/globalmessages.properties URL: http://svn.apache.org/viewvc/struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/globalmessages.properties?rev=417241&view=auto == --- struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/globalmessages.properties (added) +++ struts/action2/trunk/archetype/src/main/resources/archetype-resources/src/main/resources/globalmessages.properties Mon Jun 26 10:19:55 2006 @@ -0,0 +1,5 @@ +# +# Here is where the global I18n messages goes +# + +some.key=Some Messages Propchange: struts/action2/trunk/archetype/src/main/reso
svn commit: r417306 - in /struts/shale/trunk: shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/TokenTestCase.java shale-core/src/main/java/org/apache/shale/component/Token.jav
Author: craigmcc Date: Mon Jun 26 15:36:38 2006 New Revision: 417306 URL: http://svn.apache.org/viewvc?rev=417306&view=rev Log: Fix issue SHALE-182 (token tag would not allow resubmit after validation error was corrected). Re-enable the system integration test that verifies this behavior. Modified: struts/shale/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/TokenTestCase.java struts/shale/trunk/shale-core/src/main/java/org/apache/shale/component/Token.java Modified: struts/shale/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/TokenTestCase.java URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/TokenTestCase.java?rev=417306&r1=417305&r2=417306&view=diff == --- struts/shale/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/TokenTestCase.java (original) +++ struts/shale/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/TokenTestCase.java Mon Jun 26 15:36:38 2006 @@ -218,7 +218,6 @@ submit(submit); // Verify that we were returned to the main menu -/* FIXME - Comment out remaining assertions due to SHALE-182 until it is fixed assertEquals("Shale Framework Use Cases", title()); // Restore the saved page and submit it again @@ -240,7 +239,6 @@ assertNotNull(message); // FIXME - for some reason the text is not displayed??? MyFaces issue??? //assertTrue(message.asText().contains("Invalid resubmit of the same form")); -*/ } Modified: struts/shale/trunk/shale-core/src/main/java/org/apache/shale/component/Token.java URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-core/src/main/java/org/apache/shale/component/Token.java?rev=417306&r1=417305&r2=417306&view=diff == --- struts/shale/trunk/shale-core/src/main/java/org/apache/shale/component/Token.java (original) +++ struts/shale/trunk/shale-core/src/main/java/org/apache/shale/component/Token.java Mon Jun 26 15:36:38 2006 @@ -162,6 +162,18 @@ */ public void validate(FacesContext context) { +// If any of the other input components in this form triggered +// validation errors, we do NOT want to validate the token component +// here, because that would erase the saved token and prevent the +// subsequent valid resubmit from succeeding. +// +// WARNING - for this test to be successful, the token component must +// be the last input component child of the parent form to be +// processed +if (context.getMaximumSeverity() != null) { +return; +} + super.validate(context); String token = (String) getValue(); if (log.isDebugEnabled()) {
[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 -- == Action Classes == - The goal of an Action class is to process a request and return an ActionForward object that identifies where control should be transferred (e.g. a JSP page, Tile definition, Velocity template, or another Action) to provide the appropriate response. + The goal of an Action class is to process a request and return an ActionForward object. !ActionForward object identifies where control should be transferred to provide the appropriate response. + + !ActionForward object usually designate another Action (see [:ActionChaining:action chaining]) or a presentation page (illustrated below). Struts is agnostic to presentation technology, so response can be generated from JSP file, Tile definition, Velocity template, XSLT stylesheet or other source. + + inline:basic_action.gif == Action As Simple Service == In its simplest form Action class handles all incoming requests with one callback method, {{{execute()}}}. Two overloaded versions of this method are available. Choosing one or another depends on your servlet environment. A non-HTTP execute() method has been provided for applications that are not specifically geared towards the HTTP protocol, but most projects will only use the HTTP version since the majority of teams using the framework are focused on building web applications:
[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 -- !ActionForward object usually designate another Action (see [:ActionChaining:action chaining]) or a presentation page (illustrated below). Struts is agnostic to presentation technology, so response can be generated from JSP file, Tile definition, Velocity template, XSLT stylesheet or other source. inline:basic_action.gif + + !ActionForward object represents a logical outcome of processing a request. By not defining a specific menu choice or a page URL it is possible to separate state of a resource from its visual representation. + + '''Example''' + + Consider the Action that performs a search. The author of this code should not care about how the search results are presented, his only job is to say "what happened" when the search took place. + + Logically, there are three interesting outcomes we might want to describe: + * No results at all 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. The outcomes returned by an action are much more stable than the target locations. == Action As Simple Service == In its simplest form Action class handles all incoming requests with one callback method, {{{execute()}}}. Two overloaded versions of this method are available. Choosing one or another depends on your servlet environment. A non-HTTP execute() method has been provided for applications that are not specifically geared towards the HTTP protocol, but most projects will only use the HTTP version since the majority of teams using the framework are focused on building web applications:
svn commit: r417330 - in /struts/shale/trunk: pom.xml shale-apps/shale-blank/pom.xml shale-apps/shale-clay-usecases/pom.xml shale-apps/shale-usecases/pom.xml
Author: wsmoak Date: Mon Jun 26 19:53:21 2006 New Revision: 417330 URL: http://svn.apache.org/viewvc?rev=417330&view=rev Log: SHALE-179 Maven 2 build improvements. * Add the ability to activate each profile with a system property as well as the profile ID. * Add an 'apps' profile to the shale-parent pom, so that the entire project can be built at once if desired. Modified: struts/shale/trunk/pom.xml struts/shale/trunk/shale-apps/shale-blank/pom.xml struts/shale/trunk/shale-apps/shale-clay-usecases/pom.xml struts/shale/trunk/shale-apps/shale-usecases/pom.xml (contents, props changed) Modified: struts/shale/trunk/pom.xml URL: http://svn.apache.org/viewvc/struts/shale/trunk/pom.xml?rev=417330&r1=417329&r2=417330&view=diff == --- struts/shale/trunk/pom.xml (original) +++ struts/shale/trunk/pom.xml Mon Jun 26 19:53:21 2006 @@ -58,8 +58,24 @@ designtime + + +designtime + + shale-designtime + + + +apps + + +apps + + + +shale-apps Modified: struts/shale/trunk/shale-apps/shale-blank/pom.xml URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-apps/shale-blank/pom.xml?rev=417330&r1=417329&r2=417330&view=diff == --- struts/shale/trunk/shale-apps/shale-blank/pom.xml (original) +++ struts/shale/trunk/shale-apps/shale-blank/pom.xml Mon Jun 26 19:53:21 2006 @@ -116,6 +116,11 @@ itest + + +itest + + Modified: struts/shale/trunk/shale-apps/shale-clay-usecases/pom.xml URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-apps/shale-clay-usecases/pom.xml?rev=417330&r1=417329&r2=417330&view=diff == --- struts/shale/trunk/shale-apps/shale-clay-usecases/pom.xml (original) +++ struts/shale/trunk/shale-apps/shale-clay-usecases/pom.xml Mon Jun 26 19:53:21 2006 @@ -130,6 +130,11 @@ itest + + +itest + + Modified: struts/shale/trunk/shale-apps/shale-usecases/pom.xml URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-apps/shale-usecases/pom.xml?rev=417330&r1=417329&r2=417330&view=diff == --- struts/shale/trunk/shale-apps/shale-usecases/pom.xml (original) +++ struts/shale/trunk/shale-apps/shale-usecases/pom.xml Mon Jun 26 19:53:21 2006 @@ -129,6 +129,11 @@ itest + + +itest + + Propchange: struts/shale/trunk/shale-apps/shale-usecases/pom.xml -- svn:eol-style = native
svn commit: r417332 - /struts/site/src/site/xdoc/volunteers.xml
Author: mikus Date: Mon Jun 26 20:20:40 2006 New Revision: 417332 URL: http://svn.apache.org/viewvc?rev=417332&view=rev Log: Added myself to the committer's list Modified: struts/site/src/site/xdoc/volunteers.xml Modified: struts/site/src/site/xdoc/volunteers.xml URL: http://svn.apache.org/viewvc/struts/site/src/site/xdoc/volunteers.xml?rev=417332&r1=417331&r2=417332&view=diff == --- struts/site/src/site/xdoc/volunteers.xml (original) +++ struts/site/src/site/xdoc/volunteers.xml Mon Jun 26 20:20:40 2006 @@ -174,6 +174,10 @@ Ian Roughley (roughley at apache.org) + +Michael Jouravlev +(mikus at apache.org) + @@ -1253,6 +1257,45 @@ sub-projects, though I'm keeping an eye on Ti and some of the other experimental work that's going on. + +Michael Jouravlev -- Committer + + In 2001 I joined a team that had been tasked with building a front + end to a lottery system using Java technology. The system had to have + Web interface (HTML), cellular phone interface (WML and later SMS) + as well as audio interface for regular telephone + (VoiceXML). Someone suggested to use Struts. I did not know about Struts + at that time, but the framework quickly proved to be superior to simple + JSP-based Model1 approach. The team effort resulted in a multi-layer + application that is still competitive and maintainable today. + + Struts proved its value, but some common practices seemed + inconvenient or plain wrong to me. I started to read what other people + say. I found great value in Ted Husted's tips, as well as in the book + by Chuck Cavaness. After a while I devised some practices of my own + (or just + http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost";>rediscovered + something that others has been doing for long time) + and since then I have been trying to improve Struts in different + ways. + + I started to think about page flows and Back button support back in + 2002, this resulted in a simple but robust wizard engine. I also + wanted to make development with Struts more object-oriented. I found + DispatchAction useful in this regards but with quirks of its own. So I + created my own dispatch action that allowed me to process both input + and render phases of a web resource. Promoting this approach is a + job of its own. + + My most recent area of interest is web components and Ajax. + Creating independent components using Ajax is actually simpler than + using less fancy patterns like redirect-after-post. In attempt to + combine Ajax and non-Ajax components into one package I came up with + idea of http://www.jspcontrols.net/";>dual-mode components + that work either with or without Javascript. + + Struts has been good to me. I want Struts to keep being improved and to + remain the Java web framework of choice.
svn commit: r417334 - /struts/site/pom.xml
Author: wsmoak Date: Mon Jun 26 20:38:51 2006 New Revision: 417334 URL: http://svn.apache.org/viewvc?rev=417334&view=rev Log: Update parent pom version. Modified: struts/site/pom.xml Modified: struts/site/pom.xml URL: http://svn.apache.org/viewvc/struts/site/pom.xml?rev=417334&r1=417333&r2=417334&view=diff == --- struts/site/pom.xml (original) +++ struts/site/pom.xml Mon Jun 26 20:38:51 2006 @@ -23,7 +23,7 @@ org.apache.struts struts-parent - 2-SNAPSHOT + 3-SNAPSHOT 4.0.0
[Struts Wiki] Update of "Shale/BuildingWithMaven2" by WendySmoak
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 WendySmoak: http://wiki.apache.org/struts/Shale/BuildingWithMaven2 The comment on the change is: New instructions for the profiles. -- __To build all of shale__ (run from the root of your local Subversion checkout of shale) || Command || Status || Requires || Artifacts || - || $mvn || success (!MyFaces) || || For each project under the root, you'll see {project}/target/{project}-{ver}.jar, and for each sample app under shale-apps/, {app}/target/{app}.war || + || $mvn || success || (!MyFaces) || For each project under the root, you'll see {project}/target/{project}-{ver}.jar, || + || $mvn -P apps || success || (!MyFaces) || In addition to the jars, for each sample app under shale-apps/, {app}/target/{app}.war || || $mvn -Djsf=ri || success (JSF RI) || || || || $mvn -Pdesigntime || Must have Sun Studio Creator jars installed in your local maven repository, see designtime/pom.xml for details || || || '''Note:''' The shale-tiger and shale-sql-browser modules will only be built if you are using Java SE 5 (JDK 1.5). The profile is automatically activated by the presence of JDK 1.5, there is nothing extra to add to the command line. + '''Note:''' Profiles may be activated with -P and the profile ID or by -D and a system property with the same name. The following two commands are equivalent: + {{{ + mvn -P apps,designtime + mvn -Dapps -Ddesigntime + }}} __To build the Shale web site__ @@ -48, +54 @@ }}} The file(s) will be in target/assembly/out + + __IDE config files__ + + To generate IntelliJ IDEA config files for the entire project, use JDK 1.5 (so that shale-tiger and shale-sql-browser will be included) then execute: + {{{ mvn idea:idea -Papps,designtime }}} +
svn commit: r417340 - /struts/site/src/site/xdoc/volunteers.xml
Author: martinc Date: Mon Jun 26 22:03:53 2006 New Revision: 417340 URL: http://svn.apache.org/viewvc?rev=417340&view=rev Log: Change of employer. Modified: struts/site/src/site/xdoc/volunteers.xml Modified: struts/site/src/site/xdoc/volunteers.xml URL: http://svn.apache.org/viewvc/struts/site/src/site/xdoc/volunteers.xml?rev=417340&r1=417339&r2=417340&view=diff == --- struts/site/src/site/xdoc/volunteers.xml (original) +++ struts/site/src/site/xdoc/volunteers.xml Mon Jun 26 22:03:53 2006 @@ -576,18 +576,13 @@ A large majority of the people who contribute to Apache -projects -are volunteers who are not paid for their contributions. -Like most -of those volunteers, I also have a "day job" to put bread -on the -table. Currently, I am a UI Architect at Informatica, -where I work -on the architecture, design and implementation of web -applications. +projects are volunteers who are not paid for their +contributions. Like most of those volunteers, I also have +a "day job" to put bread on the table. Currently, I am a +Software Architect at EMC, where I work on the Documentum +family of products, focussed on the WDK/WebTop platform. Working with, and on, Struts has provided me with an -excellent -perspective with which to do that! +excellent perspective with which to do that! David Winterfeldt -- Emeritus
svn commit: r417348 - in /struts/shale/trunk/shale-tiger/src: main/java/org/apache/shale/tiger/faces/ main/java/org/apache/shale/tiger/managed/ test/java/org/apache/shale/tiger/config/
Author: craigmcc Date: Mon Jun 26 22:45:25 2006 New Revision: 417348 URL: http://svn.apache.org/viewvc?rev=417348&view=rev Log: SHALE-191 -- Rename @Value to @Property (deprecating @Value) Added: struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java (with props) Modified: struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/faces/LifecycleListener.java struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Value.java struts/shale/trunk/shale-tiger/src/test/java/org/apache/shale/tiger/config/TestBean.java Modified: struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/faces/LifecycleListener.java URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/faces/LifecycleListener.java?rev=417348&r1=417347&r2=417348&view=diff == --- struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/faces/LifecycleListener.java (original) +++ struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/faces/LifecycleListener.java Mon Jun 26 22:45:25 2006 @@ -42,6 +42,7 @@ import org.apache.shale.tiger.config.FacesConfigConfig; import org.apache.shale.tiger.config.FacesConfigParser; import org.apache.shale.tiger.managed.Bean; +import org.apache.shale.tiger.managed.Property; import org.apache.shale.tiger.managed.Scope; import org.apache.shale.tiger.managed.Value; import org.apache.shale.tiger.managed.config.ManagedBeanConfig; @@ -602,6 +603,16 @@ if (log().isTraceEnabled()) { log().trace(" Scanning field '" + field.getName() + "'"); } +Property property = (Property) field.getAnnotation(Property.class); +if (property != null) { +ManagedPropertyConfig mpc = new ManagedPropertyConfig(); +mpc.setName(field.getName()); +mpc.setType(field.getType().getName()); // FIXME - primitives, arrays, etc. +mpc.setValue(property.value()); +mbc.addProperty(mpc); +continue; +} +// Support deprecated @Value annotation as well Value value = (Value) field.getAnnotation(Value.class); if (value == null) { continue; Added: struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java?rev=417348&view=auto == --- struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java (added) +++ struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java Mon Jun 26 22:45:25 2006 @@ -0,0 +1,44 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.shale.tiger.managed; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Field-level annotation indicating that the decorated field should be + * initialized to a literal or value binding expression value specified by the + * value attribute, when a managed instance of the containing + * class is instantiated. + * + * @since 1.0.3 + */ [EMAIL PROTECTED](RetentionPolicy.RUNTIME) [EMAIL PROTECTED](ElementType.FIELD) +public @interface Property { + +/** + * The string representation of the literal value, or value + * binding expression, used to intiialize this field. + * Appropriate type conversion will be performed. + */ +String value(); + + +} Propchange: struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java -- svn:eol-style = native Propchange: struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java -- svn:keywords = Date Author Id Revision HeadURL Modified: struts/shale/trunk/shale-tiger/src/main/java/org/apac
svn commit: r417355 - in /struts/shale/trunk/shale-tiger/src: main/java/org/apache/shale/tiger/faces/LifecycleListener.java main/java/org/apache/shale/tiger/managed/Property.java test/java/org/apache/
Author: craigmcc Date: Mon Jun 26 23:40:21 2006 New Revision: 417355 URL: http://svn.apache.org/viewvc?rev=417355&view=rev Log: SHALE-185 -- Make it possible to specify the name of the managed property that is annotated by a @Property annotation (@Value is now deprecated, so do not bother to be backwards compatible with that). The default is to make the property name match the field name, matching the previous hard coded behavior. This is also forward compatible with a future scenario where the @Property annotation might be allowed on a getter or setter method, where the default property name is derived from the method name, but still allows overriding the default. Modified: struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/faces/LifecycleListener.java struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java struts/shale/trunk/shale-tiger/src/test/java/org/apache/shale/tiger/config/TestBean.java Modified: struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/faces/LifecycleListener.java URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/faces/LifecycleListener.java?rev=417355&r1=417354&r2=417355&view=diff == --- struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/faces/LifecycleListener.java (original) +++ struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/faces/LifecycleListener.java Mon Jun 26 23:40:21 2006 @@ -606,7 +606,11 @@ Property property = (Property) field.getAnnotation(Property.class); if (property != null) { ManagedPropertyConfig mpc = new ManagedPropertyConfig(); -mpc.setName(field.getName()); +String name = property.name(); +if (name == null) { +name = field.getName(); +} +mpc.setName(name); mpc.setType(field.getType().getName()); // FIXME - primitives, arrays, etc. mpc.setValue(property.value()); mbc.addProperty(mpc); Modified: struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java?rev=417355&r1=417354&r2=417355&view=diff == --- struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java (original) +++ struts/shale/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/managed/Property.java Mon Jun 26 23:40:21 2006 @@ -25,13 +25,23 @@ * Field-level annotation indicating that the decorated field should be * initialized to a literal or value binding expression value specified by the * value attribute, when a managed instance of the containing - * class is instantiated. + * class is instantiated. If desired, you may also specify the property name + * that corresponds to the annotated field, rather than relying on the default + * assumption that the field name is identical to the property name. * * @since 1.0.3 */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface Property { + +/** + * The name of the JavaBeans property to which this annotation corresponds. + * If not specified, the name of the field + * is presumed to be the name of the property as well. + */ +String name() default ""; + /** * The string representation of the literal value, or value Modified: struts/shale/trunk/shale-tiger/src/test/java/org/apache/shale/tiger/config/TestBean.java URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-tiger/src/test/java/org/apache/shale/tiger/config/TestBean.java?rev=417355&r1=417354&r2=417355&view=diff == --- struts/shale/trunk/shale-tiger/src/test/java/org/apache/shale/tiger/config/TestBean.java (original) +++ struts/shale/trunk/shale-tiger/src/test/java/org/apache/shale/tiger/config/TestBean.java Mon Jun 26 23:40:21 2006 @@ -34,8 +34,8 @@ /** * Holds value of property byteProperty. */ -@Property("-1") -private byte byteProperty = (byte) 1; +@Property(name="byteProperty", value="-1") +private byte m_byteProperty = (byte) 1; /** * Getter for property byteProperty. @@ -43,7 +43,7 @@ */ public byte getByteProperty() { -return this.byteProperty; +return this.m_byteProperty; } /**
[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 -- The goal of an Action class is to process a request and return an ActionForward object. !ActionForward object identifies where control should be transferred to provide the appropriate response. - !ActionForward object usually designate another Action (see [:ActionChaining:action chaining]) or a presentation page (illustrated below). Struts is agnostic to presentation technology, so response can be generated from JSP file, Tile definition, Velocity template, XSLT stylesheet or other source. + !ActionForward object usually designate another Action (see [:ActionChaining:action chaining]) or a presentation page. Struts is agnostic to presentation technology, so response can be generated from JSP file, Tile definition, Velocity template, XSLT stylesheet or other source. - - inline:basic_action.gif !ActionForward object represents a logical outcome of processing a request. By not defining a specific menu choice or a page URL it is possible to separate state of a resource from its visual representation. + + The following picture illustrates the difference between Struts and ASP.NET using a simple "render page" use case. In ASP.NET the request means "Display a page", in Struts request means "Display a view that corresponds to current status of an Action". + + inline:basic_action_asp.gif '''Example''' @@ -27, +29 @@ * 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. The outcomes returned by an action are much more stable than the target locations. + 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 target locations. On contrary, in ASP.NET the outcome is the page that was requested. - == Action As Simple Service == + == Action As Service == + In its simplest form Action class handles all incoming requests with one callback method, {{{execute()}}}. Two overloaded versions of this method are available. Choosing one or another depends on your servlet environment. A non-HTTP execute() method has been provided for applications that are not specifically geared towards the HTTP protocol, but most projects will only use the HTTP version since the majority of teams using the framework are focused on building web applications: {{{public ActionForward execute(ActionMapping mapping, @@ -37, +40 @@ HttpServletRequest request, HttpServletResponse response) throws Exception;}}} - + + + == Action And Setup/Submit Pattern == + + A request/response sequence of an interactive web application has two phases. On render phase (or output phase) browser requests a web resource to render itself. On input phase (or submit phase) browser sends input data to a web resource, usually by submitting an HTML form. These two phases are closely related to GET and POST methods of HTTP request. + HTTP specification recommends to use POST for non-idempotent requests, and to use GET for requests that can be repeated several times with the same outcome. In simpler terms, POST requests should be generally used to modify application state, while GET requests should be used to render a view. - - An interactive web application implements the above HTTP requirements using a two-phase input/output protocol. On ''render phase'' (or output phase) the browser requests a view from the server. On ''input phase'' (or submit phase) the browser sends input data to an application, usually by submitting an HTML form. In Struts the two-phase request/response approach is traditionally implemented with setup/submit pattern and two kinds of actions: * setup action (pre-action, output action, render action) prepares output data before displaying a JSP page; * submit action (post-action, input action, accept action) accepts user input. - This pattern is a de-facto standard, because unlike servlet, that processes GET and POST requests with {{{doGet()}}} and {{{doPost()}}} methods respectively, Action class handles all incoming requests with only one {{{execute()}}} method. + This pattern became a de-facto standard because unlike servlet, that processes GET and POST requests with {{{doGet()}}} and {{{doPost()}}} methods respectively, Action class handles all incoming requests with only one {{{execute()}}} method. inline:setup_submit.gif @@ -67, +73 @@ Set
[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 -- This setup/submit pattern looks far more complex that simple ASP.NET request/response cycle: - inline:asp_render_submit.gif - Besides the complexity of implementation, Struts setup/submit pattern has other design and usability implications: * The focus is a page, not a web resource in general. * One Action deals with only one message, like {{{updateCustomer.do}}} deals with "Update Customer" event, {{{deleteCustomer.do}}} deals with "Delete Customer" event.
[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 -- Setup action loads data from database and queues it into one or more arbitrary objects located in the request or session scope. Submit action processes input data and redisplays the same data entry form if errors has been found in the input. If input does not contain errors, submit action forwards to a success page. - This setup/submit pattern looks far more complex that simple ASP.NET request/response cycle: + This setup/submit pattern looks far more complex than similar ASP.NET request/response cycle: + + inline:asp_render_submit.gif Besides the complexity of implementation, Struts setup/submit pattern has other design and usability implications: * The focus is a page, not a web resource in general.