Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 98218 invoked from network); 27 Aug 2007 15:47:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Aug 2007 15:47:39 -0000 Received: (qmail 64121 invoked by uid 500); 27 Aug 2007 15:47:26 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 64096 invoked by uid 500); 27 Aug 2007 15:47:26 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 64085 invoked by uid 99); 27 Aug 2007 15:47:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Aug 2007 08:47:26 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Aug 2007 15:48:12 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1IPgnr-00051W-Kn for user@struts.apache.org; Mon, 27 Aug 2007 08:46:59 -0700 Message-ID: <12351943.post@talk.nabble.com> Date: Mon, 27 Aug 2007 08:46:59 -0700 (PDT) From: mraible To: user@struts.apache.org Subject: Re: How can I tell Struts 2 to throw/log exceptions for invalid OGNL Expressions In-Reply-To: <12282397.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: matt@raibledesigns.com References: <11659700.post@talk.nabble.com> <12282397.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org 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: >> >> >> >> However, if I change it to an invalid class name, it fails silently: >> >> >> >> 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" > %> > > var="q"><%=EnumCodec.URL.encode(SettingsServlet.ACTIONS.networkUpdates)%> > > > > VS: > > value="url(@vs@SETTINGS_SERVLET).q(@org.foo.bar.baz.enums.EnumCodec@URL.encode(@org.foo.bar.baz.SettingsServlet$ACTIONS@networkUpdates))"/> > > 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: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org