Ohh ok, thanks. I googled about that and i found that i can add a variable
or Object to page context with this:
pageContext.setAttribute("obj", obj);
Thanks.
2009/11/9 Musachy Barroso
> That's because creating an object in a scriptlet doesn't mean it will
> be in the page context, you need to
That's because creating an object in a scriptlet doesn't mean it will
be in the page context, you need to actually add it to the context.
musachy
On Mon, Nov 9, 2009 at 1:47 PM, Oscar Calderón wrote:
> Hi to all, this is my first question here. I have a doubt about the use of
> OGNL expressions
Hi to all, this is my first question here. I have a doubt about the use of
OGNL expressions on JSP to access to an object that i declared in a
scriptlet in the same JSP.
I have the following code:
<%
AnObject obj = request.getSession().getAttribute(AnObject.OBJECT_NAME);
%>
If the variable you're looking for is stored in the context you will
be able to retrieve it like this in a JSP:
${stack.context['com.opensymphony.xwork2.ActionContext.name']}
If you're using Freemarker then you can simply go:
stack.findString("com.opensymphony.xwork2.ActionContext.name")
But yo
Yes, but how does solve this problem?
On 9/28/07, Zarar Siddiqi <[EMAIL PROTECTED]> wrote:
>
> Did you know you have all the variables declared in this class as
> public static final at your disposal:
>
>
> http://svn.apache.org/viewvc/struts/struts2/tags/STRUTS_2_0_9/core/src/main/java/org/apache
Did you know you have all the variables declared in this class as
public static final at your disposal:
http://svn.apache.org/viewvc/struts/struts2/tags/STRUTS_2_0_9/core/src/main/java/org/apache/struts2/views/util/ContextUtil.java?revision=558805&view=markup
They include "stack"and "ognl".
Zara
Hell, I give up! Can someone show me how to fetch the action context name
off the value stack from inside a jsp? This works fine from an action but
doesn't quite follow the java beans convention!
invocation.getStack().findString("com.opensymphony.xwork2.ActionContext.name
")
--
Scott
[EMAIL PR
7 matches
Mail list logo