I am trying to add an object to the ValueStack prior to invoking the
action; however my action is not able to see the added value in the
stack.  What is wrong with this code?

// Interceptor method
@Override
public String intercept(ActionInvocation invocation)
throws Exception {
  ValueStack stack = ActionContext.getContext().getValueStack();
  stack.setValue("my.test.key", new String("Hello World"));
  return invocation.invoke();
}

// In Action Class
public String testMethod()
throws Exception {
  String s = (String)
ActionContext.getContext().getValueStack().findValue("my.test.key");
  log.debug("my.test.key : " + (s != null ? s : "<null>");
}

I constantly get "my.test.key : <null>".

Why?

Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to