You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Dakota Jack <da...@gmail.com> on 2005/01/09 19:42:34 UTC
1.3 and ActionForm
Recently I read where there was some move afoot to alter the
"attachment" of ActionForm to the framework. I cannot find that. Can
someone fill me in on plans with ActionForm in 1.3 or even before 1.3?
Thanks.
Jack
--
------------------------------
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
"You can't wake a person who is pretending to be asleep."
~Native Proverb~
"Each man is good in His sight. It is not necessary for eagles to be crows."
~Hunkesni (Sitting Bull), Hunkpapa Sioux~
-----------------------------------------------
"This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation."
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: 1.3 and ActionForm
Posted by Joe Germuska <Jo...@Germuska.com>.
>Well, unless I've missed something, there is nothing underway to
>change ActionForm. With the recent move to a chain based processor
>(commons-chain), the way the ActionForm is populated may change, but
>that won't impact your application, it is totally under the covers.
One small but likely change will be to switch to using a different
method for validation. Something like this:
public void validate(ActionContext context) {
ActionErrors validationResults =
this.validate(context.getRequest(), (ActionMapping)
context.getActionConfig();
context.addErrors(validationResults);
context.setValid(Boolean.valueOf( validationResults == null
|| validationResults.size() == 0 ));
}
This lets us move forward towards eliminating the ActionErrors class.
I don't recall any more substantial changes being proposed.
Joe
>There are definitely best practices when it comes to how to
>effectively use ActionForm. Several of my former clients chose to
>ignore those warnings and then got pissed off when (can you believe
>*during* user acceptance testing) all of a sudden they were seeing
>some "strange BeanUtils.populate errors". I hated to say "I told you
>so", but I did anyway ;)
>
>It is my understanding that with JSF and Shale, how form data is
>shuffled around and validated will, with all hope, handle those
>issues for the developer. I am by no means an expert on JSF/Shale,
>but that will (given enough free time) change. I am finally
>somewhat up-to-speed with Chain and look forward to contributing to
>this effort.
>
>Right now, we just need to get the repository back into shape so
>that we can move on with the latest progress.
>
>
>
>--
>James Mitchell
>Software Engineer / Open Source Evangelist
>EdgeTech, Inc.
>678.910.8017
>AIM: jmitchtx
>
>----- Original Message ----- From: "Dakota Jack" <da...@gmail.com>
>To: "James Mitchell" <jm...@apache.org>
>Sent: Sunday, January 09, 2005 2:36 PM
>Subject: Re: 1.3 and ActionForm
>
>>Hi, James,
>>
>>I tried to indicate that I did not mean "attachment" in the normal
>>sense by putting it into scare-quotes. I mean how ActionForm "works
>>with" the framework and I am not talking in any sense about file
>>uploads. Someone was talking about treating ActionForm as a "mere"
>>data repository or something like that and suggested some changes were
>>in the works. Sorry I cannot be more specific. If I could, I
>>probably would be able to find the original discussino. Thanks for
>>asking me to clarify this.
>>
>>Jack
>>
>><snip>
>>On Sun, 9 Jan 2005 13:55:11 -0500, James Mitchell
>><jm...@apache.org> wrote:
>>>What are you talking about? "attachment" ???
>>>
>>>Are you talking about some change with file upload?
>>>
>>>> Recently I read where there was some move afoot to alter the
>>>> "attachment" of ActionForm to the framework. I cannot find that. Can
>>>> someone fill me in on plans with ActionForm in 1.3 or even before 1.3?
>>>> Thanks.
>></snip>
>>
>>--
>>------------------------------
>>
>>"You can lead a horse to water but you cannot make it float on its back."
>>
>>~Dakota Jack~
>>
>>"You can't wake a person who is pretending to be asleep."
>>
>>~Native Proverb~
>>
>>"Each man is good in His sight. It is not necessary for eagles to be crows."
>>
>>~Hunkesni (Sitting Bull), Hunkpapa Sioux~
>>
>>-----------------------------------------------
>>
>>"This message may contain confidential and/or privileged information.
>>If you are not the addressee or authorized to receive this for the
>>addressee, you must not use, copy, disclose, or take any action based
>>on this message or any information herein. If you have received this
>>message in error, please advise the sender immediately by reply e-mail
>>and delete this message. Thank you for your cooperation."
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>For additional commands, e-mail: dev-help@struts.apache.org
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
RE: 1.3 and ActionForm
Posted by Alan Mehio <al...@yahoo.co.uk>.
The other way I see it is that, we are moving from dealing with HTML pages
into pure java coding with very clean architecture and separation of tiers.
All done in Java. Silver Stream Application server has the property to
generate client listener and so on. Now we have complete tools all done in
java.
> -----Original Message-----
> From: Sean Schofield [mailto:sean.schofield@gmail.com]
> Sent: 10 January 2005 17:27
> To: Struts Developers List; craigmcc@apache.org
> Subject: Re: 1.3 and ActionForm
>
>
> One way to look at the whole Struts vs. JSF issue is to think about it
> in terms of architecture and maintenance. There are a lot of JSF
> features that one could easily respond to by saying "Yes, well Struts
> has that too." This was my first reaction and the brand new stuff
> will obviously draw the most initial interest.
>
> As Craig has pointed out in the last post there are lots of
> similarities. Even though there are some cases where JSF features are
> similar, I have found that they are often implemented in a superior
> fashion. No suprise here as the JSF group was able to draw on lessons
> learned from Struts (and other frameworks.)
>
> One new feature that I love is the value change event. This was
> something that I really needed in my struts apps. When writing a
> webapp that is more "app" than "web" you're not just filling out forms
> and updating shopping carts. Sometimes you'd really like to know when
> field x has changed. In Struts I had to basically had to stored
> cloned copies of my beans in the form because I wanted to know which
> fields had changed and what the previous and new values were.
>
> Now in JSF, you just have to use the value change event. No more
> implementing cloneable for every freakin bean (and member bean.) Nice
> elegant solution. The more stuff in JSF that I find like this, the
> closer I move towards implementing the next app w/faces (or Shale)
> instead of Struts.
>
> Anyways, that's just another way of looking at it.
>
> sean
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: 1.3 and ActionForm
Posted by Sean Schofield <se...@gmail.com>.
One way to look at the whole Struts vs. JSF issue is to think about it
in terms of architecture and maintenance. There are a lot of JSF
features that one could easily respond to by saying "Yes, well Struts
has that too." This was my first reaction and the brand new stuff
will obviously draw the most initial interest.
As Craig has pointed out in the last post there are lots of
similarities. Even though there are some cases where JSF features are
similar, I have found that they are often implemented in a superior
fashion. No suprise here as the JSF group was able to draw on lessons
learned from Struts (and other frameworks.)
One new feature that I love is the value change event. This was
something that I really needed in my struts apps. When writing a
webapp that is more "app" than "web" you're not just filling out forms
and updating shopping carts. Sometimes you'd really like to know when
field x has changed. In Struts I had to basically had to stored
cloned copies of my beans in the form because I wanted to know which
fields had changed and what the previous and new values were.
Now in JSF, you just have to use the value change event. No more
implementing cloneable for every freakin bean (and member bean.) Nice
elegant solution. The more stuff in JSF that I find like this, the
closer I move towards implementing the next app w/faces (or Shale)
instead of Struts.
Anyways, that's just another way of looking at it.
sean
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: 1.3 and ActionForm
Posted by Craig McClanahan <cr...@gmail.com>.
On Sun, 9 Jan 2005 14:57:41 -0500, James Mitchell <jm...@apache.org> wrote:
[snip[
>
> It is my understanding that with JSF and Shale, how form data is shuffled
> around and validated will, with all hope, handle those issues for the
> developer. I am by no means an expert on JSF/Shale, but that will (given
> enough free time) change. I am finally somewhat up-to-speed with Chain and
> look forward to contributing to this effort.
>
Shale and JSF do indeed change things -- you don't need form beans at all.
Struts uses form beans for the following things:
* Save the string representation of each input
field, so you can reproduce what the user
expects even in case of conversion errors
(this is why it is recommended that form bean
properties be strings)
* A place to hang validation logic
* An implicit bean to be associated
with a particular form so you only
have to specify the property name
on the JSP page (although, if you're
using nested beans, you're already
using more complex expressions).
* As a resource that gets instantiated
for you on demand, in either request
or session scope.
JSF components handle the first two responsibilities all by
themselves, so you can do all your manipulation directly with model
properties and native data types -- and the model properties don't get
updated unless all of your validations have succeeded (hooking up to
Commons Validator is on the list of things to be added to Shale). For
the third scenario, JSF value binding expressions are a little longer
(you need to include the name of the form bean on the front), but you
gain the ability to bind to more than one bean if you want or need to.
For the fourth responsibility, JSF generalizes the way that Struts
creates form beans for you to create *any* bean on demand, including
configuring its properties, in an IoC like pattern based on setter
injection.
The "Shale Use Cases" example app has some illustrations of what I
expect to be a common pattern in JSF and frameworks based around it --
a backing bean similar to a Struts Action (except that it gets
instantiated once per request, like WebWorks does it, so you don't
have to worry about thread safety considerations) will contain:
* Properties for each data item on the form, but using the native
data types since you don't have to worry about conversions).
It's also reasonable to collect properties for more than one page
for things like a wizard dialog.
* Event handlers for each submit button on that form, which JSF
calls directly (so you don't need anything like a DispatchAction
either).
* Event handlers for value change events if you want to change
the behavior of your application in response to these.
* You can even bind to "validator" methods in the backing bean,
if you need some application specific validation and don't want
to go to the hassle of creating an external validator class and
registering it with the component.
Then, if you're updating a database or something, the event handler
for your "Save" button will acquire a reference to the appropriate DAO
(or Hibernate session, or EJB, or whatever) and modify it
appropriately.
Fewer moving parts makes for simpler code and fewer mistakes.
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: 1.3 and ActionForm
Posted by James Mitchell <jm...@apache.org>.
I see what you mean now.
Well, unless I've missed something, there is nothing underway to change
ActionForm. With the recent move to a chain based processor
(commons-chain), the way the ActionForm is populated may change, but that
won't impact your application, it is totally under the covers.
There are definitely best practices when it comes to how to effectively use
ActionForm. Several of my former clients chose to ignore those warnings and
then got pissed off when (can you believe *during* user acceptance testing)
all of a sudden they were seeing some "strange BeanUtils.populate errors".
I hated to say "I told you so", but I did anyway ;)
It is my understanding that with JSF and Shale, how form data is shuffled
around and validated will, with all hope, handle those issues for the
developer. I am by no means an expert on JSF/Shale, but that will (given
enough free time) change. I am finally somewhat up-to-speed with Chain and
look forward to contributing to this effort.
Right now, we just need to get the repository back into shape so that we can
move on with the latest progress.
--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx
----- Original Message -----
From: "Dakota Jack" <da...@gmail.com>
To: "James Mitchell" <jm...@apache.org>
Sent: Sunday, January 09, 2005 2:36 PM
Subject: Re: 1.3 and ActionForm
> Hi, James,
>
> I tried to indicate that I did not mean "attachment" in the normal
> sense by putting it into scare-quotes. I mean how ActionForm "works
> with" the framework and I am not talking in any sense about file
> uploads. Someone was talking about treating ActionForm as a "mere"
> data repository or something like that and suggested some changes were
> in the works. Sorry I cannot be more specific. If I could, I
> probably would be able to find the original discussino. Thanks for
> asking me to clarify this.
>
> Jack
>
> <snip>
> On Sun, 9 Jan 2005 13:55:11 -0500, James Mitchell <jm...@apache.org>
> wrote:
>> What are you talking about? "attachment" ???
>>
>> Are you talking about some change with file upload?
>>
>> > Recently I read where there was some move afoot to alter the
>> > "attachment" of ActionForm to the framework. I cannot find that. Can
>> > someone fill me in on plans with ActionForm in 1.3 or even before 1.3?
>> > Thanks.
> </snip>
>
> --
> ------------------------------
>
> "You can lead a horse to water but you cannot make it float on its back."
>
> ~Dakota Jack~
>
> "You can't wake a person who is pretending to be asleep."
>
> ~Native Proverb~
>
> "Each man is good in His sight. It is not necessary for eagles to be
> crows."
>
> ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
>
> -----------------------------------------------
>
> "This message may contain confidential and/or privileged information.
> If you are not the addressee or authorized to receive this for the
> addressee, you must not use, copy, disclose, or take any action based
> on this message or any information herein. If you have received this
> message in error, please advise the sender immediately by reply e-mail
> and delete this message. Thank you for your cooperation."
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: 1.3 and ActionForm
Posted by James Mitchell <jm...@apache.org>.
What are you talking about? "attachment" ???
Are you talking about some change with file upload?
--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx
----- Original Message -----
From: "Dakota Jack" <da...@gmail.com>
To: "Struts Developers List" <de...@struts.apache.org>
Sent: Sunday, January 09, 2005 1:42 PM
Subject: 1.3 and ActionForm
> Recently I read where there was some move afoot to alter the
> "attachment" of ActionForm to the framework. I cannot find that. Can
> someone fill me in on plans with ActionForm in 1.3 or even before 1.3?
> Thanks.
>
> Jack
>
>
>
> --
> ------------------------------
>
> "You can lead a horse to water but you cannot make it float on its back."
>
> ~Dakota Jack~
>
> "You can't wake a person who is pretending to be asleep."
>
> ~Native Proverb~
>
> "Each man is good in His sight. It is not necessary for eagles to be
> crows."
>
> ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
>
> -----------------------------------------------
>
> "This message may contain confidential and/or privileged information.
> If you are not the addressee or authorized to receive this for the
> addressee, you must not use, copy, disclose, or take any action based
> on this message or any information herein. If you have received this
> message in error, please advise the sender immediately by reply e-mail
> and delete this message. Thank you for your cooperation."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org