Return-Path: X-Original-To: apmail-struts-user-archive@www.apache.org Delivered-To: apmail-struts-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C886B10105 for ; Thu, 2 Jan 2014 16:17:26 +0000 (UTC) Received: (qmail 64635 invoked by uid 500); 2 Jan 2014 16:17:21 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 64609 invoked by uid 500); 2 Jan 2014 16:17:19 -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 64362 invoked by uid 99); 2 Jan 2014 16:17:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jan 2014 16:17:16 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paulus.benedictus@gmail.com designates 209.85.128.49 as permitted sender) Received: from [209.85.128.49] (HELO mail-qe0-f49.google.com) (209.85.128.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jan 2014 16:17:10 +0000 Received: by mail-qe0-f49.google.com with SMTP id w7so14267772qeb.36 for ; Thu, 02 Jan 2014 08:16:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=dSK+fZgZz9k6AixHywSCKFwYrSVIivQKijJnDCHudo8=; b=iKVraYTJGRLb3Bkmwhdqj1LO1fR+HxA8PbOEVMvP++ae4yCR4uazFopu+AHAmR3ZwE 5HZ/tIYc5VErFPxUH5KfP5nkQsX5U9TZwSRs+oeflduw8akqnkbtj9e3kK5FFQor+2Cc NJ218lQuwPYgJWAAFqHLAI9AspXcjnPjs38BtceD1Pj08nBv1pIl3api0Jkh0RwFat8g K4pDEFTfIn3/O82YBEHOaSuHNPGVS6kyBAg2+LmuW5e02DLbMODQHdmIM+b0jlXsGSPW g6EBMOUaPpvJgsWpv6Pg6r6JIZyLklh4hxMET9RiLsZNwtsKSlaALzUqA2O+koL1R7ks dzFg== MIME-Version: 1.0 X-Received: by 10.49.52.34 with SMTP id q2mr144554642qeo.10.1388679409925; Thu, 02 Jan 2014 08:16:49 -0800 (PST) Sender: paulus.benedictus@gmail.com Received: by 10.96.223.3 with HTTP; Thu, 2 Jan 2014 08:16:49 -0800 (PST) In-Reply-To: References: Date: Thu, 2 Jan 2014 10:16:49 -0600 X-Google-Sender-Auth: N8oHtvhn_05dzY7S9vylcCDN4LI Message-ID: Subject: Re: Tiles with Annotations From: Paul Benedict To: Struts Users Mailing List Content-Type: multipart/alternative; boundary=047d7bea3f34ef849e04eeff1ebd X-Virus-Checked: Checked by ClamAV on apache.org --047d7bea3f34ef849e04eeff1ebd Content-Type: text/plain; charset=ISO-8859-1 Annotations usually help augment the class being annotated. I don't think annotating a Struts action with Tile definitions is very appropriate for this purpose. The purposes are just very different. XML seems more appropriate than annotations here. On Thu, Jan 2, 2014 at 10:02 AM, Christoph Nenning < Christoph.Nenning@lex-com.net> wrote: > Dear List, > > > in our applications we often use the convention-plugin together with > tiles-plugin (tiles 2). > > convention-plugin has the advantage that it is not necessary to put an > entry in struts.xml for each action. So struts.xml usually is very small. > But we still have tiles.xml which needs an entry for each action. In big > applications that file becomes huge and hard to maintain. > > To fix that I created a bunch of Annotations and a struts2 result to be > able to create tile defs with annotations. > > > It would take me some time to turn that into a proper framework patch. > > Now my question is: Do you like that stuff? > > > > Sample application code: > > > -------------------------------------------- > tiles.xml > -------------------------------------------- > > "/WEB-INF/tiles/layout/layout.jsp"> > > > > > > > > > > -------------------------------------------- > SampleAction > -------------------------------------------- > @Result(name=SampleAction.INPUT, type="tiles-annotation") > @TileDef( > extend=".default-layout", > attributes={ > @TileAttribute(name="titleMsgKey", value="text.key.test"), > @TileAttribute(name="content", value= > "/WEB-INF/tiles/test/test.jsp") > } > ) > public class SampleAction extends ActionSupport { > ... > } > > > -------------------------------------------- > web.xml > -------------------------------------------- > > > > > > org.apache.struts2.tiles.StrutsTilesAnnotationsListener > > > > org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG > /WEB-INF/classes/tiles.xml param-value> > > > > > > regards, > Christoph > > This Email was scanned by Sophos Anti Virus > -- Cheers, Paul --047d7bea3f34ef849e04eeff1ebd--