Return-Path: X-Original-To: apmail-tiles-users-archive@minotaur.apache.org Delivered-To: apmail-tiles-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EADFB4657 for ; Mon, 11 Jul 2011 06:33:02 +0000 (UTC) Received: (qmail 68154 invoked by uid 500); 11 Jul 2011 06:33:00 -0000 Delivered-To: apmail-tiles-users-archive@tiles.apache.org Received: (qmail 67822 invoked by uid 500); 11 Jul 2011 06:32:38 -0000 Mailing-List: contact users-help@tiles.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@tiles.apache.org Delivered-To: mailing list users@tiles.apache.org Delivered-To: moderator for users@tiles.apache.org Received: (qmail 85747 invoked by uid 99); 9 Jul 2011 08:35:14 -0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of duvduv@gmail.com designates 209.85.216.180 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=fOwWOrO3LnVpOJlnDhIIEUI/Ruh6ckNtM0GHbqn/SHE=; b=qKdrSaWOHEph5uWEg3/MJud+UXk11lwJGtyu3pi2ZtPsHVLEwhv5RALTgbD4M5J5z4 bTCR17PSO7ydtn2QagVZw38Y/L36KW7J3gv0TFIV4qBHQSf+zhva+1qjn2Y5ZdDBMYdw qMpyseHweVjmHLNR8UHoMSgSYjAi2d21DuSGc= MIME-Version: 1.0 Date: Sat, 9 Jul 2011 11:34:46 +0300 Message-ID: Subject: Partial include with Tiles From: duvduv To: users@tiles.apache.org Content-Type: text/plain; charset=UTF-8 Hey all, I'm new to Tiles and I'm having a bit of a difficulty maintaining a large set of views. Maybe someone can tell me what I'm doing wrong/how can I do it better. I'm developing a webapp with many views, all of these are composed around a single template. The template has about three or four "placeholders" (attributes), and for each view, different, dynamically generated content (JSP for that matter) should be placed in the correct placeholder. When I define a new view with Tiles I need to create multiple JSP file - each with a placeholder's content. Then I need to update a huge XML definition file that has a lot of entries that look just the same, and a similar properties file (I'm working with Spring's ResourceBundleViewResolver but that's not the main issue). I'm looking for a solution that'll allow me to declare all these placeholder's content in the same file, and partially include this file into the template (every fragment to its placeholder). For example, I might be having this as template.jsp: [...] [...]
Then I'll define the following tiles: [something that points Tiles to someView.jsp - maybe it can infer the file's name from the definition's name] Then having someView.jsp as follows:

Here's the title

And here's the body...

Instead of having someView_head.jsp and someView_body.jsp each with a single line. Am I doing it all wrong? Is there another way I'm not aware of? Thanks! - Itay