Francisco José Aquino García wrote:
2009/6/26 Dale Newfield <d...@newfield.org>:
The result doesn't evaluate bufferSize.  You can't put in OGNL there.

So... bufferSize in StreamResult would need to be parsed in a similar
way to contentLength to parse OGNL expressions?

Right. There's no magic. OGNL isn't magically replacing the expression with a primitive that can be set as a primitive -- rather the result accepts a string expression, assumes it's an ognl expression and evaluates it, and uses the result of that evaluation as the value.

"${buffSize}" is a String.

Ok, I understand that as it isn't being parsed as OGNL bufferSize
won't accept anything but a literal, but why my expression is a
String, as buffSize is defined as int in ThumbnailAction? Surely my
understanding of OGNL is quite limited. How should I rewrite it to
evaluate as an int?

The problem is that there is no evaluation going on for that value. If you need to dynamically set the buffer size, you'll need to use a different result implementation that accepts a string and evaluates it. Extending StreamResult would get you most of the way there. If you'd like to contribute your improvements back to the community, you can add those patches to a JIRA request. May I ask why you need to dynamically change the buffer size?

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to