Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 74076 invoked from network); 23 Jan 2007 20:07:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jan 2007 20:07:11 -0000 Received: (qmail 16434 invoked by uid 500); 23 Jan 2007 20:07:08 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 16088 invoked by uid 500); 23 Jan 2007 20:07:07 -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 16076 invoked by uid 99); 23 Jan 2007 20:07:07 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2007 12:07:07 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of schneidh@gmail.com designates 66.249.82.238 as permitted sender) Received: from [66.249.82.238] (HELO wx-out-0506.google.com) (66.249.82.238) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2007 12:06:58 -0800 Received: by wx-out-0506.google.com with SMTP id t11so2131244wxc for ; Tue, 23 Jan 2007 12:06:37 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=eO3AUc8KN+LTbVezqbeHbAe3qU/4ERBikgzF/cWuRiANjfThOtjUlq3uL62Nu7wlVoT2GhdAG4SOsfD8dTPorlCbV/BT8kiqu9vRdVOvjV8zM15EtU03scZisn0ig9Up50RmCMfmJhUhGnBRDO53kzXiuWpr2PXnQ4uoJDNGVeo= Received: by 10.70.90.17 with SMTP id n17mr13800244wxb.1169582797675; Tue, 23 Jan 2007 12:06:37 -0800 (PST) Received: by 10.70.39.6 with HTTP; Tue, 23 Jan 2007 12:06:37 -0800 (PST) Message-ID: Date: Tue, 23 Jan 2007 14:06:37 -0600 From: "Tom Schneider" To: "Struts Users Mailing List" Subject: Re: [s2] String comparison with OGNL In-Reply-To: <92E0A345B37A5047AA03FC4DB2C474590CF0D7@sbssrv01.DoubleA.local> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_209329_25796683.1169582797588" References: <92E0A345B37A5047AA03FC4DB2C474590CF0D7@sbssrv01.DoubleA.local> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_209329_25796683.1169582797588 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On our webwork project, we're successfully using this (copied directly from the JSP): where caseType is an bean property (from a list of beans being iterated over) that will be "SG" if the 'if' tag contents should be rendered. However, I think this might be a case of an interned string, so it would be better to use .equals which should work equally well. (We are using .equals in other places, but only to check if the string is blank) Tom On 1/23/07, Wesley Wannemacher wrote: > > When I read your message, it occurred to me that OGNL couldn't know what > type `addrType' was because my Action is only a stub. #parameters is a > magical variable containing all of the request parameters, so I hadn't > thought of making getters/setters on my Action before. > > So, I added a getAddrType() and setAddrType(String) then tried again. > > I went through the whole gambit of syntaxes and I still can't find one > that > works. > > If I'm using the correct syntax, let me know because it could just be a > bad > set of struts jars (which I can replace). > > -Wes > > > -----Original Message----- > > From: Tom Schneider [mailto:schneidh@gmail.com] > > Sent: Tuesday, January 23, 2007 1:50 PM > > To: Struts Users Mailing List > > Subject: Re: [s2] String comparison with OGNL > > > > #parameters.addrType is of type String correct? If not, e.g. > > if it were an > > enum, then I would expect all the comparisons to fail. You might try > > #parameters.addrType.toString().equals('billing') and see if > > that gets it to > > work. > > Tom > > > > > ------=_Part_209329_25796683.1169582797588--