struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adam pinder <apin...@hotmail.co.uk>
Subject RE: Weird behavior in getText()
Date Wed, 24 Mar 2010 17:56:51 GMT

 
the only thing i have different is a space before and after the = in the resource file
 
apart from that i'm using getText as you are.
 
adam


----------------------------------------
> Date: Tue, 23 Mar 2010 11:12:19 -0700
> Subject: Weird behavior in getText()
> From: thechrispratt@gmail.com
> To: user@struts.apache.org
>
> I'm seeing some weird behavior in ActionSupport.getText() that is causing me
> some problems in Struts 2.0.14. From the docs (and my previous experience),
> getText() retrieves entries from the resource bundle's associated with the
> application. But for some reason, in my current instance it's trying to
> evaluate the resource bundle key as an OGNL expression. Am I doing
> something wrong?
>
> In my application.properties file I have:
>
> chart.netFrameSales.title=Net Frame Sales
>
> In my ChartNetFrameSalesAction I have:
>
> public JFreeChart getChart () {
> String title = getText("chart.netFrameSales.title");
>
> which is causing infinite recursion because OGNL is seeing the "chart." and
> going to the value stack, calling getChart() and round and round we go.
>
> The Relevant part of the stack trace shows:
>
> [2010-03-23 11:10:47,307] WARN {abcOu3jlPU3Rf_9tFPSzs}
> OgnlValueStack.logLookupFailure: Caught an exception while evaluating
> expression 'chart' against value stack
> Caught an Ognl exception while getting property chart - Class:
> ognl.OgnlRuntime
> File: OgnlRuntime.java
> Method: getMethodValue
> Line: 1416 - ognl/OgnlRuntime.java:1416:-1
> at
> com.opensymphony.xwork2.util.CompoundRootAccessor.getProperty(CompoundRootAccessor.java:106)
> at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2210)
> at ognl.ASTProperty.getValueBody(ASTProperty.java:114)
> at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
> at ognl.SimpleNode.getValue(SimpleNode.java:258)
> at ognl.Ognl.getValue(Ognl.java:494)
> at ognl.Ognl.getValue(Ognl.java:458)
> at com.opensymphony.xwork2.util.OgnlUtil.getValue(OgnlUtil.java:190)
> at
> com.opensymphony.xwork2.util.OgnlValueStack.findValue(OgnlValueStack.java:228)
> at
> com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:431)
> at
> com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:293)
> at
> com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:173)
> at
> com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:88)
> at com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:71)
> at
> com.vsp.global.controller.ChartNetFrameSalesAction.getChart(ChartNetFrameSalesAction.java:84)
>
>
> Is this a misconfiguration on my part, or bad documentation around the
> ActionSupport.getText() method?
> (*Chris*) 		 	   		  
_________________________________________________________________
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message