You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Sgarlata Matt <sg...@bah.com> on 2003/08/16 19:15:33 UTC
parameter vs. set-property (was Re: Flexible form support)
Ted Husted wrote:
> IMHO, the "general purpose" parameter has been a useful feature of
> ActionConfig/ActionMapping and is worth applying elsewhere. We just have
> to be quick to remind people that if they outgrow the general purpose
> parameter, then they should start extending the base object and using
> set-property. (As people often do now.)
I agree; <set-property> is my favorite Struts extension point :)
However, I would like to point out that it doesn't work very well for
the <message-resources> element. The reason for this is that
<set-property> populates a MessageResourcesConfig object instead of the
actual MessageResources object. Then in the ActionServlet, when the
MessageResources object is initialized it is passed the "parameter"
information but is not passed any <set-property> information:
// here the resources are created, and passed the parameter
MessageResources resources =
factoryObject.createResources(mrcs[i].getParameter());
// here the resources are passed the return null info
resources.setReturnNull(mrcs[i].getNull());
//!! here I think we should pass the MessageResourcesConfig
getServletContext().setAttribute(
mrcs[i].getKey() + config.getPrefix(),
resources);
What do you think? Would this be a reasonable enhancement request? Can
I post it in BugZilla with patches?
> -Ted.
Matt
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
Re: parameter vs. set-property (was Re: Flexible form support)
Posted by Robert Leland <rl...@apache.org>.
Sgarlata Matt wrote:
> Robert Leland wrote:
>
>> Sgarlata Matt wrote:
>>
>>> What do you think? Would this be a reasonable enhancement request?
>>> Can I post it in BugZilla with patches?
>>
>>
>> Since you have talked about it on the struts-user group, and it looks
>> like the existing system makes your
>> life harder, then open a Bugzilla request. What ever committer looks
>> at the bug request will determine if the patch will be applied or
>> modified.
>> [Patches] are always welcome and speed the process ! If possible
>> patch against the current HEAD of struts source
>> code. Use the diff -u old new. I also like to use 'diff -u 5 old new'
>> just to be sure.
>
>
> I've never used CVS before so I don't know what you mean. What is the
> current HEAD of struts source code mean?
HEAD/CVS
The HEAD means the most current version of source code of by default the
TRUNK.
This source can be downloaded from
http://cvs.apache.org/builds/jakarta-struts/nightly/src/
IF I had said 'submit patches against the HEAD of the STRUTS_1_1_BRANCH,
then
you would have to use CVS directly to get to this source.
The Mozilla site has a nice graphic
http://www.mozilla.org/roadmap/branching-2003-06-24.png
of Trunks and Branches.
So if you would like provide patches against the most recient
source code, http://cvs.apache.org/builds/jakarta-struts/nightly/src/
You can use the commons jars found in the struts nightly build
found at the binary is at
http://cvs.apache.org/builds/jakarta-struts/nightly
to build and test your patches. If you haven't built struts before
the only file you'll need to modify is the build.properties file
which just a copy of the build.properties.sample file.
> The Jakarta site says
>
> cvs diff -u Main.java >> patchfile.txt
>
> is preferred. Can I use that instead?
DIFF
If you are NOT using CVS then you'll need to use the command
diff -u 4 file1.old.java file1.new.java >> file1.diff
IF you are using windows then you'll need to install Cygwin
to get the 'diff' program.
If you are using are using CVS then I yes use the
cvs diff -u 4 file1.java >> file1.diff command.
-Rob
>
>> -Rob
>>
>
--
Robert Leland Robert@free2create.org
------------------------------------------
Java, J2EE, Struts, Web Application Development
804 N. Kenmore Street +01-703-525-3580
Arlington VA 22201
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
Re: parameter vs. set-property (was Re: Flexible form support)
Posted by Sgarlata Matt <sg...@bah.com>.
Robert Leland wrote:
> Sgarlata Matt wrote:
>
>> What do you think? Would this be a reasonable enhancement request?
>> Can I post it in BugZilla with patches?
>
> Since you have talked about it on the struts-user group, and it looks
> like the existing system makes your
> life harder, then open a Bugzilla request. What ever committer looks at
> the bug request will determine if the patch will be applied or modified.
> [Patches] are always welcome and speed the process ! If possible patch
> against the current HEAD of struts source
> code. Use the diff -u old new. I also like to use 'diff -u 5 old new'
> just to be sure.
I've never used CVS before so I don't know what you mean. What is the
current HEAD of struts source code mean? The Jakarta site says
cvs diff -u Main.java >> patchfile.txt
is preferred. Can I use that instead?
> -Rob
>
--
Matthew Sgarlata
Senior Consultant
Booz Allen Hamilton Inc.
Work: 703-377-0871
Fax: 703-902-3608
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
Re: parameter vs. set-property (was Re: Flexible form support)
Posted by Robert Leland <rl...@apache.org>.
Sgarlata Matt wrote:
> Ted Husted wrote:
>
>> IMHO, the "general purpose" parameter has been a useful feature of
>> ActionConfig/ActionMapping and is worth applying elsewhere. We just
>> have to be quick to remind people that if they outgrow the general
>> purpose parameter, then they should start extending the base object
>> and using set-property. (As people often do now.)
>
>
> I agree; <set-property> is my favorite Struts extension point :)
> However, I would like to point out that it doesn't work very well for
> the <message-resources> element. The reason for this is that
> <set-property> populates a MessageResourcesConfig object instead of
> the actual MessageResources object. Then in the ActionServlet, when
> the MessageResources object is initialized it is passed the
> "parameter" information but is not passed any <set-property> information:
>
> // here the resources are created, and passed the parameter
> MessageResources resources =
> factoryObject.createResources(mrcs[i].getParameter());
> // here the resources are passed the return null info
> resources.setReturnNull(mrcs[i].getNull());
> //!! here I think we should pass the MessageResourcesConfig
> getServletContext().setAttribute(
> mrcs[i].getKey() + config.getPrefix(),
> resources);
>
> What do you think? Would this be a reasonable enhancement request?
> Can I post it in BugZilla with patches?
Since you have talked about it on the struts-user group, and it looks
like the existing system makes your
life harder, then open a Bugzilla request. What ever committer looks at
the bug request will determine if the patch will be applied or modified.
[Patches] are always welcome and speed the process ! If possible patch
against the current HEAD of struts source
code. Use the diff -u old new. I also like to use 'diff -u 5 old new'
just to be sure.
-Rob
--
Robert Leland Robert@free2create.org
------------------------------------------
Java, J2EE, Struts, Web Application Development
804 N. Kenmore Street +01-703-525-3580
Arlington VA 22201
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org