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 C188F9959 for ; Wed, 1 Feb 2012 04:32:20 +0000 (UTC) Received: (qmail 94332 invoked by uid 500); 1 Feb 2012 04:32:20 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 94259 invoked by uid 500); 1 Feb 2012 04:32:17 -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 Delivered-To: moderator for users@camel.apache.org Received: (qmail 33616 invoked by uid 99); 31 Jan 2012 17:32:36 -0000 X-ASF-Spam-Status: No, hits=3.0 required=5.0 tests=FORGED_YAHOO_RCVD,NORMAL_HTTP_TO_IP,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Date: Tue, 31 Jan 2012 09:12:41 -0800 (PST) From: dunnlow To: users@camel.apache.org Message-ID: <1328029961794-5445156.post@n5.nabble.com> Subject: Accessing a Map header via Simple? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi. I have a Map in my header and I am trying to access it via Simple in my spring dsl. I see an example using body in the documentation and am extrapolating that for my header purposes. However, I'm getting a NullPointerException, so I am thinking I've got bad syntax. My map holds key/value pairs like -> {("user1","http://127.0.0.1/serv/s1"),("user2","http://127.0.0.1/serv/s2)} and has been added to the headers and is named uriMap. I want to do a lookup on "user1" for example. I'm trying: user1=${in.header.uriMap[user1]} Question: - Is it ok without quotes around user1? - If there is no user1 in the map, can I use the .? to avoid a NPE like: in.header?.uriMap[user1]? Thanks! -J -- View this message in context: http://camel.465427.n5.nabble.com/Accessing-a-Map-header-via-Simple-tp5445156p5445156.html Sent from the Camel - Users mailing list archive at Nabble.com.