Is it possible to use altSyntax to solve this problem? In other words, require %{} around all expressions? Looking through the docs, it doesn't seem like altSyntax is supported in Struts 2.
https://issues.apache.org/struts/browse/WW-1819 Thanks, Matt mraible wrote: > > > mraible wrote: >> >> I have the following class: >> >> public class TestAction { >> >> public static String concat(String str1, String str2) { >> return str1 + " and " + str2; >> } >> } >> >> In a JSP, I can write the following and it works fine: >> >> <s:property value="@[EMAIL PROTECTED]('1', '2')"/> >> >> However, if I change it to an invalid class name, it fails silently: >> >> <s:property value="@[EMAIL PROTECTED]('1', '2')"/> >> >> I've tried turning up the logging for org.apache.struts2, >> com.opensymphony.xwork2 and ognl - but it still fails silently. Any ideas >> how to get better error messages about invalid OGNL expressions? >> > > I'll take that as a "no", it is not possible to get better error messages. > That's too bad since it seems I get better type-safety and errors from > scriptlets instead of OGNL. > > <%@ page > import="org.foo.bar.baz.SettingsServlet,org.foo.bar.baz.enums.EnumCodec" > %> > > <c:set > var="q"><%=EnumCodec.URL.encode(SettingsServlet.ACTIONS.networkUpdates)%></c:set> > > <s:property value="url(@[EMAIL PROTECTED]).q('${q}')"/> > > VS: > > <s:property > value="url(@[EMAIL PROTECTED]).q(@[EMAIL PROTECTED](@[EMAIL PROTECTED]))"/> > > The framework I'm looking to migrate to Struts 2 has the ability for it's > EL to read from imported Statics - a pretty cool feature IMO. > > ${url(pageBean.MAPPING.SETTINGS_SERVLET).q(EnumCodec.URL.encode(SettingsServlet.ACTIONS.networkUpdates))} > > Matt > > -- View this message in context: http://www.nabble.com/How-can-I-tell-Struts-2-to-throw-log-exceptions-for-invalid-OGNL-Expressions-tf4100102.html#a12351943 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]