Sometimes you have to sacrifice the purist way, believe me :-))

-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] la part de
Tim Dwelle
Envoyé : jeudi 16 octobre 2003 19:47
À : [EMAIL PROTECTED]
Objet : RE: [OS-webwork] Set attributes in an Action


Quoting Fred Lamuette <[EMAIL PROTECTED]>:

> I think ActionContext.getParameters().set(name,value) doesn't work

Ok, I wasn't sure about that one...


> but to
> your question I can answer that I'm using the displaytag
> (www.displaytag.org) that works like a charm without of course
> reading the
> data source form the WW stack. Displaytag uses the regular scopes,
> and
> either you write <ww:set ...value="results" scope="request"> in the
> jsp page
> or you add directly the result in the request attributes from an
> Action
> method.

Now, maybe I'm being too much of purist here... but if my opinion, the
correct option is to use the <ww:set /> tag.

My argument is this:  the action should *care* that you're using it
displaytag, or velocity, or any other sort of view decision.  Those
are the responsibility of the view.  The action should only be
concerned with executing its logic.

If you decide to change the way you display your data, you want to
isolate those changes to the view tier.  You should not need to touch
your actions at all.  This is the whole point of using MVC.


> And my code is not ugly ;-)

I dunno... what brace-style do you use? :-D



> Richard.

-Tim.



>
> -----Message d'origine-----
> De : [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] la part
> de
> Tim Dwelle
> Envoyé : jeudi 16 octobre 2003 15:56
> À : [EMAIL PROTECTED]
> Objet : RE: [OS-webwork] Set attributes in an Action
>
>
> Ok, I usually let questions like this go... but this time, I'll
> bite.
> Why would you *want* to set a request attribute in an action?
>
> That's the kind of ugliness you need to do in Struts, not Webwork.
> :)
>
> But to your question, I believe ActionContext.getParameters().set
> (name,value) would work as well... without needlessly coupling your
> action to ServletActionContext.
>
> -Tim.
>
>
>
>
> Quoting Jason Carreira <[EMAIL PROTECTED]>:
>
> > ServletActionContext.getRequest().setAttribute(...)
> >
> > -----Original Message-----
> > From: Fred Lamuette [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, October 16, 2003 2:59 AM
> > To: [EMAIL PROTECTED]
> > Subject: [OS-webwork] Set attributes in an Action
> >
> > How to set elegantly a request attribute in an action
> > (request.setAttribute(name,value)) ?
> > Cheers.
> > Richard.



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork



-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise
Linux in the Boardroom; in the Front Office; & in the Server Room
http://www.enterpriselinuxforum.com
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to