Wes Wannemacher wrote:
Hello,

I have been struggling to find a way to see what the namespace is from
within a JSP. So, from the view, I would like to know what the namespace
is of the action that was called. The following scriptlet correctly returns the namespace - <%
com.opensymphony.xwork2.ActionContext ac =
com.opensymphony.xwork2.ActionContext.getContext();
com.opensymphony.xwork2.ActionInvocation invo =
ac.getActionInvocation();
com.opensymphony.xwork2.ActionProxy proxy = invo.getProxy();
out.println(proxy.getNamespace());
%>

But, if I use the following OGNL -
<s:property
value="@[EMAIL PROTECTED]().actionInvocation.proxy.namespace"/>

I just get a big fat nothing :(

Hi Wes,

Works for me!

<s:property value="@[EMAIL PROTECTED]().actionInvocation.proxy.namespace"/>

Outputs:
/secure

when used in a JSP result for an action within the package definition :

<package name="admin" extends="secure" namespace="/secure">

in Struts 2.0.11

cheers,
Jeromy Evans

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

Reply via email to