Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 88213 invoked from network); 13 Jul 2010 23:08:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Jul 2010 23:08:17 -0000 Received: (qmail 4638 invoked by uid 500); 13 Jul 2010 23:08:15 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 4598 invoked by uid 500); 13 Jul 2010 23:08:15 -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 4590 invoked by uid 99); 13 Jul 2010 23:08:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jul 2010 23:08:15 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [69.89.12.240] (HELO chrismiles.org) (69.89.12.240) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jul 2010 23:08:07 +0000 Received-SPF: none (chrismiles.org: chris@chrismiles.org does not designate permitted sender hosts) receiver=chrismiles.org; client-ip=90.195.49.43; helo=OBIWAN; envelope-from=chris@chrismiles.org; x-software=spfmilter 0.97 http://www.acme.com/software/spfmilter/ with libspf2-1.0.0; Received: from OBIWAN (5ac3312b.bb.sky.com [90.195.49.43]) by chrismiles.org (8.13.8/8.13.8) with SMTP id o6DN5imv020369 for ; Tue, 13 Jul 2010 23:05:44 GMT Message-ID: <009701cb22df$ed64d1d0$0400a8c0@OBIWAN> From: "Chris Miles" To: "Struts Users Mailing List" References: <000601cb202e$f69622d0$0400a8c0@OBIWAN><002701cb22bf$2cff2e10$0400a8c0@OBIWAN><004a01cb22d4$632c7460$0400a8c0@OBIWAN><005e01cb22da$0af3b5f0$0400a8c0@OBIWAN><006f01cb22de$a6c789d0$0400a8c0@OBIWAN> Subject: Re: Currency Formatting Date: Wed, 14 Jul 2010 00:05:45 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3664 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3664 X-Virus-Checked: Checked by ClamAV on apache.org HTML rendering just completely stops at that point. I get the following: This is a product name And nothing else for the rest of the page. Nothing in the logs. Nothing :) Chris ----- Original Message ----- From: "Chris Pratt" To: "Struts Users Mailing List" Sent: Wednesday, July 14, 2010 12:03 AM Subject: Re: Currency Formatting > Define "fails", you get a stack trace? you don't get the output you > expected? If so, what were you expecting vs. what did you get? I've used > that code a thousand times, so I'm not sure what could be going wrong... > (*Chris*) > > On Tue, Jul 13, 2010 at 3:56 PM, Chris Miles wrote: > >> Thanks Chris. The reason I use this method in my iterators is there are a >> few places where I use nested iterators so the # notation is the only way >> to >> access the current iterator but also the parent iterator. >> >> This specific iterator is not nested so I have changed it for learning >> and >> trial sake and it fails with the line >> >> > value="price"/> >> >> I can put >> >> >> >> and it displays the value fine. >> >> >> Chris >> >> ----- Original Message ----- From: "Chris Pratt" >> >> To: "Struts Users Mailing List" >> Sent: Tuesday, July 13, 2010 11:28 PM >> Subject: Re: Currency Formatting >> >> >> I've never used the iterator tag like that, the standard way to use the >>> Struts 2 Iterator would be: >>> >>> >>> >>> £>> name="format.currency">>> value="price"/> >>> >>> >>> Since the iterator tag puts the current value on the top of the stack, >>> there's no reason to define a variable to hold it. It's much simpler to >>> just use the value stack to pull the values from. Don't know if this >>> might >>> help or not. >>> (*Chris*) >>> >>> On Tue, Jul 13, 2010 at 3:23 PM, Chris Miles >>> wrote: >>> >>> Chris, >>>> >>>> I have a list of products which contain a double price. >>>> >>>> I now have. >>>> >>>> >>>> >>>> £>>> name="format.currency">>>> value="#product.price"/> >>>> >>>> >>>> >>>> Chris >>>> ----- Original Message ----- From: "Chris Pratt" < >>>> thechrispratt@gmail.com> >>>> To: "Struts Users Mailing List" >>>> Sent: Tuesday, July 13, 2010 11:04 PM >>>> >>>> Subject: Re: Currency Formatting >>>> >>>> >>>> puts the value on the top of the stack, so if you have a >>>> list >>>> >>>>> of doubles, we'll call it amounts, it would look something like this: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> (*Chris*) >>>>> >>>>> On Tue, Jul 13, 2010 at 2:43 PM, Chris Miles >>>>> wrote: >>>>> >>>>> Chris, >>>>> >>>>>> >>>>>> Hi that works perfectly for >>>>>> >>>>>> >>>>>> >>>>>> where total is public Double getTotal >>>>>> >>>>>> but causes all rendering to stop at the following within an iterator. >>>>>> >>>>>> >>>>>> >>>>>> where List getProducts (for the iterator), public Product >>>>>> getProduct and public Double getPrice >>>>>> >>>>>> and also fails just on >>>>>> >>>>>> >>>>> value="product.price"/> >>>>>> >>>>>> where public Product getProduct >>>>>> >>>>>> Is there places where different mechanisms need to be used here? I >>>>>> dont >>>>>> understand the inconstistant result I now get. >>>>>> >>>>>> Nothing in the log files on TRACE >>>>>> >>>>>> >>>>>> Thanks >>>>>> >>>>>> Chris >>>>>> ----- Original Message ----- From: "Chris Pratt" < >>>>>> thechrispratt@gmail.com> >>>>>> To: "Struts Users Mailing List" >>>>>> Sent: Tuesday, July 13, 2010 8:16 PM >>>>>> Subject: Re: Currency Formatting >>>>>> >>>>>> >>>>>> >>>>>> try instead of . >>>>>> >>>>>> (*Chris*) >>>>>>> >>>>>>> On Tue, Jul 13, 2010 at 12:11 PM, Chris Miles >>>>>>> wrote: >>>>>>> >>>>>>> At the moment I have in my struts.xml >>>>>>> >>>>>>> >>>>>>>> >>>>>>> value="ApplicationResources" >>>>>>>> /> >>>>>>>> >>>>>>>> ApplicationResources.properties is being packaged within >>>>>>>> WEB-INF\classes >>>>>>>> within a WAR within an EAR. >>>>>>>> >>>>>>>> The file contains: format.currency={0,number,currency} >>>>>>>> >>>>>>>> In my JSP I have >>>>>>> value="product.price"/> >>>>>>>> >>>>>>>> Without the s:text the price is displayed (a Double). >>>>>>>> >>>>>>>> When the s:text is included all I get is: {0} >>>>>>>> >>>>>>>> thanks >>>>>>>> >>>>>>>> Chris >>>>>>>> ----- Original Message ----- From: "Chris Pratt" < >>>>>>>> thechrispratt@gmail.com> >>>>>>>> To: "Struts Users Mailing List" >>>>>>>> Sent: Sunday, July 11, 2010 1:25 AM >>>>>>>> Subject: Re: Currency Formatting >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Define something like: >>>>>>>> >>>>>>>> >>>>>>>> format.currency={0,number,currency} >>>>>>>>> >>>>>>>>> In your applications.properties file, then use: >>>>>>>>> >>>>>>>>> >>>>>>>> value="%{amount}"/> >>>>>>>>> >>>>>>>>> HTH >>>>>>>>> (*Chris*) >>>>>>>>> >>>>>>>>> On Sat, Jul 10, 2010 at 5:53 AM, Chris Miles >>>>>>>>> >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>> Hi >>>>>>>>> >>>>>>>>> >>>>>>>>> If I am displaying a Double to a JSP page what is the recommended >>>>>>>>>> way >>>>>>>>>> to >>>>>>>>>> format this is as a currency to two decimal points? >>>>>>>>>> >>>>>>>>>> Thanks >>>>>>>>>> >>>>>>>>>> Chris >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> --------------------------------------------------------------------- >>>>>>>>> >>>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >>>>>>>> For additional commands, e-mail: user-help@struts.apache.org >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> --------------------------------------------------------------------- >>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >>>>>> For additional commands, e-mail: user-help@struts.apache.org >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >>>> For additional commands, e-mail: user-help@struts.apache.org >>>> >>>> >>>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> For additional commands, e-mail: user-help@struts.apache.org >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org