Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9E7F71158A for ; Wed, 16 Apr 2014 02:03:20 +0000 (UTC) Received: (qmail 65502 invoked by uid 500); 16 Apr 2014 02:03:19 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 65456 invoked by uid 500); 16 Apr 2014 02:03:19 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 65446 invoked by uid 99); 16 Apr 2014 02:03:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Apr 2014 02:03:18 +0000 X-ASF-Spam-Status: No, hits=1.6 required=5.0 tests=FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.160.52 as permitted sender) Received: from [209.85.160.52] (HELO mail-pb0-f52.google.com) (209.85.160.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Apr 2014 02:03:14 +0000 Received: by mail-pb0-f52.google.com with SMTP id rr13so10279053pbb.39 for ; Tue, 15 Apr 2014 19:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:content-transfer-encoding:content-disposition; bh=ygiSpmIhuJB0rXum0BkhjZrwUaPfGxaQ3/T4pbxROeU=; b=rqdrvBokZ0uH4JFLQAXjnEYR7AMNxAUhVz801KWieGWqf/AtWc/T12fejnk0d0HVTF dLZ0skBzGn61mkFjjETFUJjwDT/UfHFz/lsU492nBwfB38R7UWTUv+iPip6vBoY2Hldd fkVwgn7sWRoc9Cc7GyWJ8hnKV4P1C6J6q5yiKu990aSoObUzBKiLF8kOxU3q5TE7xwiG EJfliNMhrbpbosJXwVmDOezKwXSIk1PqgbYYE/rsHx5IJa05QuNE2rM3+dFUccyGfbk7 fKGLdOb5eeP7gIIreVbmVyDzLjSlgnxQtF+3wske2yhL18RI7yRljCuAF3x3CLobAR2U SfnQ== X-Received: by 10.68.237.133 with SMTP id vc5mr5562573pbc.92.1397613771810; Tue, 15 Apr 2014 19:02:51 -0700 (PDT) Received: from localhost ([123.116.48.167]) by mx.google.com with ESMTPSA id oz7sm43262779pbc.41.2014.04.15.19.02.49 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 19:02:50 -0700 (PDT) Date: Wed, 16 Apr 2014 10:02:41 +0800 From: Willem Jiang To: users@camel.apache.org Message-ID: In-Reply-To: References: <1397573564470-5750248.post@n5.nabble.com> <1397581997468-5750259.post@n5.nabble.com> Subject: Re: Set header from velocity template X-Mailer: Airmail (237) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org As the message header could be override or lost in the processor. My sugg= est is put the old message body into exchange property. Camel is copying = the exchange properties by default. -- =20 Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang =20 Weibo: =E5=A7=9C=E5=AE=81willem On April 16, 2014 at 1:23:59 AM, Bilgin Ibryam (bibryam=40gmail.com) wrot= e: > Velocity will put the result of the evaluation in the message body, you= > cannot change that. > But you could preserve the existing body by putting it into a header be= fore > calling velocity template, and then swap the template result with the > previous body afterwards... > =20 > HTH > =20 > =20 > =20 > On 15 April 2014 18:13, dunnlow wrote: > =20 > > Sorry, I should have given more detail. > > > > I am using velocity to create web pages. My template is an html forma= tted > > document (about 40 lines) that uses existing exchange headers. (This = gets > > turned into a web page downstream.) > > > > In my (xml) route I have something like: > > > > =20 > > > > However, this puts my html template into the BODY. I need to keep the= > > current body intact (downstream routes depend on having the original > > message) so I want to do this same evaluation, but put the new evalua= ted > > template it into a HEADER. > > > > Thanks again, > > -J > > > > > > > > -- > > View this message in context: > > http://camel.465427.n5.nabble.com/Set-header-using-velocity-template-= tp5750248p5750259.html =20 > > Sent from the Camel - Users mailing list archive at Nabble.com. > > > =20 > =20 > =20 > -- > Bilgin Ibryam > =20 > Apache Camel & Apache O=46Biz committer > Blog: ofbizian.com > Twitter: =40bibryam =20 > =20 > Author of Instant Apache Camel Message Routing > http://www.amazon.com/dp/1783283475 > =20