commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <>
Subject Re: [SCXML] jsp test
Date Thu, 09 Feb 2006 16:21:38 GMT
On 2/8/06, 박성찬 <> wrote:
> In the context of,
> there is an assignment "jspCtx.setAttribute("foo", "1");"
> but when I tried to set "" instead of "foo", it didn't work.
> It probably didn't match the context in the scxml script (<if cond="${empty(
> Tracing the EL parser, it divided two("foo" and "bar") as complex variable.
> How can you solve this?

EL is a simple expression language, and the dot operator precludes its
use in variable names. However, depending on what you're trying to do,
you may still be able to get by. Common exceptions to the above rule
include keys (maps, resource bundles), for which the [] operator may
be used instead. For example, if  "" is a key in a map stored
in variable "map", the corresponding EL expression can be used to
retrieve the value.


On the other hand, I'm not sure what your particular use case is since
you refer to a test class in the SCXML test suite. Do you need EL? Are
you using SCXML in a JSP-based environment? If not, I'd recommend
using JEXL [1] for expressions instead. This page [2] has a brief
description of how to use JEXL in SCXML documents. Ofcourse, feel free
to ask here if you have other questions. JEXL also has a FlatResolver
[3] which might be useful in your case. The SCXML JEXLEvaluator class
does not support preresolvers and postresolvers yet, but its not much
work at all so if you have a good use case, I can add that capability
fairly quickly.



> Sungchan
View raw message