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) -

<s:property value="%{myMethod()}" />

-Wes

On Thu, Jun 25, 2009 at 2:08 PM, <gd...@jslss.com> wrote:
>
> 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 "something";
>    }
> }
>
> JSP:
> <%
>
>   MyAction myAction = [##somehow get the action instance##];
>   String myMethodResult = myAction.myMethod();
>
> %>
>
> Thanks in advance,
> Graham
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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

Reply via email to