Marko,

I use this same situation for a registration page - where you want a User object
as the model, and an additional field on only the action for the confirmed
password.  

In this case, I do not implement the ModelDriven interface but have getUser()
and setUser() methods on the Action. The ParametersInterceptor happily walks
into the user object and sets all the values (on the Action and the user
object).  What I did have a problem with (a bug is logged), is with declarative
validation in this circumstance.

/Ian

--
>From Down & Around, Inc.
Innovative IT solutions
Software Architecture * Design * Development
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
web:    www.fdar.com 
email:  [EMAIL PROTECTED] 
phone:  617.821.5430
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> First of all, thanks to everybody involved in WW/XWork for great work!
> 
> When I looked into ParametersInterceptor I found this:
> 
> // populate model bean's fields if action is ModelDriven, otherwise 
> populate action's fields
> if (action instanceof ModelDriven) {
>    OgnlUtil.setProperties(ActionContext.getContext().getParameters(),
>                         ((ModelDriven) action).getModel(),
>                         ActionContext.getContext().getContextMap());
> } else {
>    OgnlUtil.setProperties(ActionContext.getContext().getParameters(),
>                           action,
>                           ActionContext.getContext().getContextMap());
> }
> 
> I have situation where my action is ModelDriven but it would be helpful 
> to set some fields which are action specific and not model. So I may 
> have an action flow control parameter like debug (bad example) which has 
> setter and getter in action. The action would otherwise work fully model 
> driven.
> 
> Looking at this interceptor code it seems that this situation is not 
> possible? I would imagine that dualism I described would be appreciated 
> though it comes with slight performance hit.
> 
> Or am I just missing something that would enable behaviour I described?
> -- 
> 
> Marko Lahma
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
> _______________________________________________
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to