Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F2AD5FB65 for ; Mon, 29 Apr 2013 09:46:17 +0000 (UTC) Received: (qmail 18759 invoked by uid 500); 29 Apr 2013 09:46:17 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 18639 invoked by uid 500); 29 Apr 2013 09:46:17 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 18426 invoked by uid 99); 29 Apr 2013 09:46:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Apr 2013 09:46:16 +0000 Date: Mon, 29 Apr 2013 09:46:16 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (WW-4062) Invalid OGNL expressions are not cached MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4062: ------------------------------ Fix Version/s: 2.3.x > Invalid OGNL expressions are not cached > --------------------------------------- > > Key: WW-4062 > URL: https://issues.apache.org/jira/browse/WW-4062 > Project: Struts 2 > Issue Type: Bug > Components: Value Stack > Affects Versions: 2.3.14 > Reporter: Saulius Tvarijonas > Fix For: 2.3.x > > > I am using velocity to render results page. During performance optimizations I noticed significant memory usage from *com.opensymphony.xwork2.ognl.OgnlUtil#compile*. There is caching implemented in OgnlUtil, but if expression compilation fails, it is not cached. > I am not really sure if this problem is in struts or velocity engine. But situation is following: > # In velocity template trying to render string *

$!foo

* > # If value is null, velocity calls *org.apache.velocity.runtime.parser.node.ASTReference#getNullString* > # Internally there is call to *context.get(".literal." + nullString)* > # And this ".literal." expression always reaches *OgnlUtil#compile* and compilation fails. > Below is stacktrace for more details: > {code} > at com.opensymphony.xwork2.ognl.OgnlUtil.compile(OgnlUtil.java:248) > at com.opensymphony.xwork2.ognl.OgnlUtil.getValue(OgnlUtil.java:236) > at com.opensymphony.xwork2.ognl.OgnlValueStack.getValueUsingOgnl(OgnlValueStack.java:291) > at com.opensymphony.xwork2.ognl.OgnlValueStack.tryFindValue(OgnlValueStack.java:274) > at com.opensymphony.xwork2.ognl.OgnlValueStack.tryFindValueWhenExpressionIsNotNull(OgnlValueStack.java:256) > at com.opensymphony.xwork2.ognl.OgnlValueStack.findValue(OgnlValueStack.java:236) > at com.opensymphony.xwork2.ognl.OgnlValueStack.findValue(OgnlValueStack.java:298) > at org.apache.struts2.dispatcher.StrutsRequestWrapper.getAttribute(StrutsRequestWrapper.java:82) > at org.apache.velocity.tools.view.context.ChainedContext.getAttribute(Unknown Source:-1) > at org.apache.velocity.tools.view.context.ChainedContext.internalGet(Unknown Source:-1) > at org.apache.velocity.context.AbstractContext.get(AbstractContext.java:193) > at org.apache.velocity.context.InternalContextAdapterImpl.get(InternalContextAdapterImpl.java:267) > at org.apache.velocity.runtime.parser.node.ASTReference.getNullString(ASTReference.java:510) > at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:465) > at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) > at org.apache.velocity.runtime.parser.node.ASTStringLiteral.value(ASTStringLiteral.java:330) > at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71) > at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142) > at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) > at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260) > at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) > at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) > at org.apache.velocity.Template.merge(Template.java:356) > at org.apache.velocity.Template.merge(Template.java:260) > at org.apache.struts2.dispatcher.VelocityResult.doExecute(VelocityResult.java:156) > at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186) > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira