Re: Struts 2.1 Accessing the action instance from a JSP

2009-06-25 Thread gdown
I was able to get access to the action from the JSP as follows (it isn't pretty but it worked) JSP: <% com.opensymphony.xwork2.ognl.OgnlValueStack stack = (com.opensymphony.xwork2.ognl.OgnlValueStack)request.getAttribute("struts.valueStack"); MyAction myAction = (MyAction)stack.findValue("actio

Re: Struts 2.1 Accessing the action instance from a JSP

2009-06-25 Thread Wes Wannemacher
Does it have to be in a scriptlet? OGNL will let you call methods, assuming the action is on top of the stack (you aren't inside of another action from the s:action tag, or you aren't in an iterator that is iterating an object that has a matching method) - -Wes On Thu, Jun 25, 2009 at 2:08 PM,

Struts 2.1 Accessing the action instance from a JSP

2009-06-25 Thread gdown
Does anyone know how to access the action instance from the value stack. I'd like to be able to call a method on the action from the JSP. I'm trying to do something like this: MyAction.java: public class MyAction extends ActionSupport { public String myMethod() { return "somethi