You should probably be doing this from an interceptor. Matt
Alexander Baetz wrote: > > 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] > > > -- View this message in context: http://www.nabble.com/How-to-putt-objects-on-the-valuestack-from-INSIDE-an-action--tp20204481p20210627.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]