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 71B4710741 for ; Thu, 2 Jan 2014 18:06:48 +0000 (UTC) Received: (qmail 497 invoked by uid 500); 2 Jan 2014 18:03:48 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 444 invoked by uid 500); 2 Jan 2014 18:03:43 -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 352 invoked by uid 99); 2 Jan 2014 18:03:30 -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 18:03:30 +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 ken.mcwilliams@gmail.com designates 209.85.214.170 as permitted sender) Received: from [209.85.214.170] (HELO mail-ob0-f170.google.com) (209.85.214.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jan 2014 18:03:24 +0000 Received: by mail-ob0-f170.google.com with SMTP id wp18so14782667obc.1 for ; Thu, 02 Jan 2014 10:03:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=DaosGV53UJhKwqO1u3HpVEbT7GigAPb62hsnwym88hw=; b=DpFRWhm7NQPesE9pnGLbOuwQzQ9cj9eMfE86P+XarCK/QbwVaIoaRM8z03P1AywTyk TkF79hjCxeZ0tT3I2FJqz/YMVizxQLnHe4r9yim+mql9wBtlBdi9ABbaeyrQkLDOUdfK T/mh9e0aajJvJZRFbKZ+OvnAYKYFJhZeLvoDNWr4ffKbgSPb+llxENtgx/zb0lnC+5NR LnK9feXyhMfGh8P7dOL4gsxIh1xqxFG3OBAo/z+KDE9ViP2v39pXJsYsmk0yhIcVIPLD ScPx2XozPisL+3dSMm4L0NKSjEyE/UVGQHWfFV9QINvwkXJ9dHUvaooheN3Wx5NxYIKt RXsw== MIME-Version: 1.0 X-Received: by 10.60.123.75 with SMTP id ly11mr54800802oeb.26.1388685783543; Thu, 02 Jan 2014 10:03:03 -0800 (PST) Received: by 10.76.88.233 with HTTP; Thu, 2 Jan 2014 10:03:03 -0800 (PST) In-Reply-To: References: Date: Thu, 2 Jan 2014 11:03:03 -0700 Message-ID: Subject: Re: Tiles with Annotations From: Ken McWilliams To: Struts Users Mailing List Content-Type: multipart/alternative; boundary=047d7b5d25e4d5338f04ef009ab6 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b5d25e4d5338f04ef009ab6 Content-Type: text/plain; charset=ISO-8859-1 I arrived at the same conclusion when trying to remove my tiles configuration. I upgraded to tiles 3 in the process and wrote a custom result handler (sorry a custom "unknown result handler"). It is invoked when conventions isn't able to find an appropriate result. Here is a stack overflow Q & A which covers that process: "How to Integrate Struts Conventions with Tiles such that the benefit of conventions is maintained" http://stackoverflow.com/q/16116142/514065 On Thu, Jan 2, 2014 at 9:16 AM, Paul Benedict wrote: > 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 > --047d7b5d25e4d5338f04ef009ab6--