I'm not sure about the convertor, but could you instead just do:

String localCode = (String)ExpressionEvaluatorManager.evaluate("locale",
expr, String.class, this, pageContext);
Locale locale = new Locale(localCode);

At least that way your only asking the ExpressionEvaluatorManager to deal
with a basic type that by default it knows how to handle.  I know, it's
not one concise line then :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Thu, March 16, 2006 3:00 pm, Mujahid Ali said:
> I have a custom tag in which I am evaluating an attribute as follow:
>
> (Locale)ExpressionEvaluatorManager.evaluate("locale", expr,
> Locale.class, this, pageContext)
>
> But I get an error:
>
> javax.servlet.jsp.JspException: An error occurred while evaluating
> custom action attribute "locale" with value "en_US": Attempt to convert
> String "en_US" to type "java.util.Locale", but there is no
> PropertyEditor for that type (null)
>     at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Unknown
> Source)
>     at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Unknown
> Source)
>     at
> org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(Unknown
> Source)
>
>
> I am using standard.jar (v 1.1).
>
> If I want to convert a String to Locale object, I assume I need to
> define some sort of PropertyEditor??
>
> Any help is appreciated.
>
> Thanks,
>
> Mujahid
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to