struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject [OT] [RANT] Re: Preparable or interceptors - is there a better mailing list than this ? some thing for total newbies.
Date Sat, 14 Apr 2007 20:15:43 GMT
--- Mansour <mansour77@yahoo.com> wrote:
> I don't understand this part. Is this list only for
> advanced users? No wonder Struts 2 has a small 
> community and poor documentation.

Dude. It's Saturday. Some of us do other things
besides read the Struts mailing list on Saturday. 

AFAICT you posted these one hour and fifteen minutes
apart. Even if it *wasn't* Saturday, what would you
have expected to have happen? 

If anybody answers *any* question on a public,
volunteer list, it's because we *want* to help people.

It's a gift, having somebody else do our work for us,
our research, our trial-and-error, our debug cycles,
our homework.

The gift of time and knowledge is not something to be
taken lightly. Some really great folks have spent a
lot of time creating WebWork/S2 and all its associated
components. A lot more people help out in whatever way
they can on the mailing list. It's not all they
do--they have families, jobs, lives. 

(Except for me, I have no life :)

>> I am trying to perform some operation on an
>> object, Therefore I need to pass to the action the 
>> object id and the parameters to add for the 
>> operation. I need to set these values before the
>> request reaches the action class.  Do I do this in 
>> the interceptor, or just implement Preperable and 
>> ServletRequestAware interfaces ?

That depends entirely upon how you're "getting to" the
action in question. From a link? From a form? From an
internally-generated request?

Why wouldn't you just put the id in a form or URL?

>> What is the difference between these two methods?

Preparable is an interface that defines a routine that
will be run when the Action is instantiated. You can
do whatever you want in it; it is not directly related
to your original question.

ServletRequestAware is an interface that provides an
HttpServletRequest setter for your action. Since it
directly ties your action to the servlet
specification, it is probably not recommended,
particularly since there are other existing ways to do
what you want, namely ParameterAware or using the
built-in XWork type conversion functionality and
passing an ID via a URL parameter or form value and
providing a setter in your action.

Dave


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message