throws EvaluationException {
String formatted;
try {
JSPDate arg =
Convert.toJSPDate(jjtGetChild(0).evaluate(pageContext,
icontext));
String pattern =
Convert.toString(jjtGetChild(1).evaluate(pageContext,
icontext));
DateFormat form;
if (jjtGetNumChildren() > 2) {
String arg3 =
Convert.toString(jjtGetChild(2).evaluate(pageContext,
icontext));
Locale locale = getLocale(arg3);
form = DateFormat.getDateInstance(DateFormat.MEDIUM, locale);
} else {
form = DateFormat.getInstance();
}
try {
((SimpleDateFormat) form).applyPattern(pattern);
formatted = form.format(new Date(arg.getTime().longValue()));
} catch (IllegalArgumentException iae) {
formatted = new String("");
}
} catch (ConversionException ce) {
throw new EvaluationException(this, ce.getMessage());