sagarlotiya wrote:
Hi,
"not going through the action " means that, directly set on "Model bean"
without going through action.

I don't think you want to avoid "going through the action". You may not want the property to be a direct property of the action (and instead have it be a property of the model object) but in *both* cases you need the action to provide access to either the direct-action property, or the model object that contains your property.

You *can* avoid that and stick your model object somewhere else (like in the context, in the session, etc.) but why? Just make the model object a property of the action and provide a getter in that same action.

Otherewise what happen, first we have to get the value in our action using
reqest.getParameter()

You probably don't want to do that. You probably want to have the params interceptor translate the request parameters for you. That way you get all the benefits of auto-type conversion, the conversion framework for custom conversions (if you need it), the validation framework, etc.

By processing params directly with request.getParameter() you're avoiding much of what makes S2 useful.

or through getter/setter using paramPrepareParamStack
and then set these values on "Model" from that action

You do not need the whole "params/prepare/params" sandwich to just get values from your forms injected into your model objects.

You just need *one* params interceptor in your stack, and then you need a *getter* for your model object in the action processing the incoming data.

In your form that feeds the action data, you use form-filed names like you're doing...

  <input type="foo" name="myModelObject.myProperty" />

As long as you've got a getter for the model object in the action that processes this form, ognl will call the getter, retrieve your model object, and then set values on the properties within that object.

OGNL will even instantiate the model object for you if you've left it null in the action.

but i don't want to do
that through ognl we can directly set the value on "Model" right ?

Right. But you still need at least one params interceptor. It's what does the work.

It works
fine for all cases but when if we will use Iterator at that time it creates
problem.

In your iterator you're naming your textfield "roles". The action that processes that form does have a "roles" object and a getter for that object, right?

If none of that helped, turn on debugging and watch your console (or stdout) while you submit the form. It's very enlightening.

- Gary

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to