Hi,

reading your mail, it seems to me that you want te redevelop what Struts 2 can already do. When you put a getter in your action, you can access to your attribute in the jsp like you seems to want to. I can't understand why you want to put another Interceptor. If it is to set always the same value, you could use hierarchy to have a class that deal with all of the common attributes and all of the others should inherit from it and implements their owns attributes.

If it is a misunderstand from me, sorry...

regards

Sébastien

Alexander Baetz a écrit :
Hi,

currently i'm trying to use my own Class to store configuration data for my application. To access the options from within the jsp page i want to use the struts 2 value stack. I somehow like the stack more than i like the session.

My problem is the following:
i can put objects in the session, but how do i put one on the stack so i can find it with something like:
value="#mySettings" ?

my current SettingsInterceptor looks like this (and doesnt work):

       // get the action on which the interceptor is fired
       Object action = actionInvocation.getAction();
       // get the value stack
ValueStack stack = actionInvocation.getInvocationContext().getValueStack();
       // try to retrieve the bean
SettingsBean settings = (SettingsBean) stack.findValue("mySettings");
       if (settings == null) {
           settings = new SettingsBean();
           stack.set("mySettings", settings);
       }
       try {
           ((SettingsBeanAware) action).setPageSettingsBean(settings);
       } catch (Exception e) {
       }
       return actionInvocation.invoke();

Greetings,
Alexander

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



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

Reply via email to