struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (WW-4228) OGNL Basic: if AllowStaticMethodAccess is set to true, JSP fragments included with <jsp:include/> can access Action members, otherwise they can't.
Date Mon, 25 Aug 2014 19:15:00 GMT

     [ https://issues.apache.org/jira/browse/WW-4228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lukasz Lenart updated WW-4228:
------------------------------

    Affects Version/s: 2.3.15.2

> OGNL Basic: if AllowStaticMethodAccess is set to true, JSP fragments included with <jsp:include/>
can access Action members, otherwise they can't.
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-4228
>                 URL: https://issues.apache.org/jira/browse/WW-4228
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 2.3.15.2
>         Environment: JBOSS EAP 6.01, Struts 2.3.15.2
>            Reporter: Andrea Ligios
>            Priority: Trivial
>              Labels: include, jsp, ognl
>             Fix For: 2.3.18
>
>
> Trying to call an Action's getter from an included JSP, I get null:
> {code:title=MyAction.java|borderStyle=solid}
> private String message = "The message I want to read...";
> public String getMessage() { 
>     return message; 
> }
> {code}
> {code:title=main.jsp|borderStyle=solid}
> <%@taglib prefix="s" uri="/struts-tags" %>
> <html>
>    <head></head>
>    <body>
>        <div> I'm a DIV in main.jsp </div>           
>        <jsp:include page="fragment.jsp" />
>    <body>
> </html>
> {code}
> {code:title=fragment.jsp|borderStyle=solid}
> <%@taglib prefix="s" uri="/struts-tags" %>
> <div>
>     I'm a DIV from fragment.jsp
>     <br/>
>     Message from Action: <s:property value="message" />
> </div>
> {code}
> If I set:
> {code:title=struts.xml|borderStyle=solid}
> <constant name="struts.ognl.allowStaticMethodAccess" value="true"/>    
> {code}
> the getter is now reachable. 
> This applies only to <jsp:include> ; with <s:include>, the getter is ALWAYS
reachable. 
> Seems to be some kind of side effect, maybe it should be verified and added to the documentation.
[Originally posted here.|http://stackoverflow.com/q/19425754/1654265]



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message