[S2] Writing a simple interceptor that set a properties of the action.

2008-03-06 Thread GF
I want to do a simple thing, I have an action like this public class MyAction { private String myVar; public setMyVar(String myVar) { this.myVar = myVar; } } Inside my Interceptor i want to put in my Action a string inside myVar property of the Action. In few words, I need to discover if the

Re: [S2] Writing a simple interceptor that set a properties of the action.

2008-03-06 Thread stanlick
Is it a dynamic value you need to set or could you use dependency injection? S On Thu, Mar 6, 2008 at 6:06 AM, GF [EMAIL PROTECTED] wrote: I want to do a simple thing, I have an action like this public class MyAction { private String myVar; public setMyVar(String myVar) { this.myVar =

Re: [S2] Writing a simple interceptor that set a properties of the action.

2008-03-06 Thread Adam Hardy
I didn't see the second half of your message until I'd sent that. What calls to the setters are you asking about? Do you mean any random property? Are you talking about HTTP parameters? Have you checked out the commons-beanutils API? Adam Hardy on 06/03/08 12:47, wrote: Unless you want to do

Re: [S2] Writing a simple interceptor that set a properties of the action.

2008-03-06 Thread Adam Hardy
Unless you want to do it via introspection, then a good way would be to set the appropriate actions to implement an interface having that setter. Then you can use instanceof to see if the action in your interceptor implements your interface. If so, cast it to the interface and call the setter.

Re: [S2] Writing a simple interceptor that set a properties of the action.

2008-03-06 Thread GF
On Thu, Mar 6, 2008 at 1:52 PM, Adam Hardy [EMAIL PROTECTED] wrote: I didn't see the second half of your message until I'd sent that. What calls to the setters are you asking about? Do you mean any random property? Are you talking about HTTP parameters? In few words, I have a property

Re: [S2] Writing a simple interceptor that set a properties of the action.

2008-03-06 Thread stanlick
You could add the generated parameter to the parameters map through your interceptor. S On Thu, Mar 6, 2008 at 7:22 AM, GF [EMAIL PROTECTED] wrote: On Thu, Mar 6, 2008 at 1:52 PM, Adam Hardy [EMAIL PROTECTED] wrote: I didn't see the second half of your message until I'd sent that. What