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 D021418AE3 for ; Sat, 16 Jan 2016 19:16:41 +0000 (UTC) Received: (qmail 83139 invoked by uid 500); 16 Jan 2016 19:16:41 -0000 Delivered-To: apmail-tiles-users-archive@tiles.apache.org Received: (qmail 83093 invoked by uid 500); 16 Jan 2016 19:16:41 -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 Received: (qmail 83081 invoked by uid 99); 16 Jan 2016 19:16:41 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jan 2016 19:16:41 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A2141C1BFE for ; Sat, 16 Jan 2016 19:16:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.101 X-Spam-Level: X-Spam-Status: No, score=-0.101 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=nlebas.net Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id oVic3-jDNG8Y for ; Sat, 16 Jan 2016 19:16:30 +0000 (UTC) Received: from ein.nlebas.net (ein.nlebas.net [198.50.197.57]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 162AE43F56 for ; Sat, 16 Jan 2016 19:16:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nlebas.net; s=net1; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject; bh=WnSjuuz6qOuazHmjUO2/kmLJxxoTWq51J8Cwjb9MRYo=; b=YmL4S3VufLWAwK3DEmqsXtcHKvl/+8hhahckyyIkIinK6aEmpwK3VAY7FHjKo7m4wmIBlHtj2tUgVZQKA/UToOjZ68SnjHZMjohJrmGBOkkNr6w6rOXF3Q+xkqVmga6JmGS+DXetwvks954QBfma5LIlSAdFlChg8IyaJaAb6fY=; Received: from cable-192.222.205.253.electronicbox.net ([192.222.205.253] helo=[192.168.1.121]) by ein.nlebas.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1aKWKk-0006Ta-Ho for users@tiles.apache.org; Sat, 16 Jan 2016 14:16:23 -0500 Subject: Re: Using Tiles 3 in Struts 2 To: users@tiles.apache.org References: <56971584.3080604@nlebas.net> From: Nicolas Le Bas Message-ID: <569A9706.9070307@nlebas.net> Date: Sat, 16 Jan 2016 14:16:22 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 192.222.205.253 X-SA-Exim-Mail-From: mail@nlebas.net X-SA-Exim-Scanned: No (on ein.nlebas.net); SAEximRunCond expanded to false On 01/14/2016 02:07 AM, Lukasz Lenart wrote: >> - #getResource(path) and #getResources(path) are used for non localized >> >resources. Tiles uses them to inventory the tiles.xml files at startup, like >> >here: >> >https://github.com/apache/tiles/blob/TILES_3_0_X/tiles-core/src/main/java/org/apache/tiles/factory/BasicTilesContainerFactory.java#L220 >> >or here: >> >https://github.com/apache/tiles/blob/TILES_3_0_X/tiles-extras/src/main/java/org/apache/tiles/extras/complete/CompleteAutoloadTilesContainerFactory.java#L203 > Those methods return ApplicationResource, how should I construct it? > Right now I'm doing it like this for all tiles*.xml definition files, > should I distinct them based on a suffix ("en", "pl")? > > https://github.com/apache/struts/pull/73/files#diff-a4ef02a35b4a5838b0cc73fa5e6236f9R113 > I think it will be OK. There is some logic in Tiles (BaseLocaleURLDefinitionDAO.setSources) that will strip the locale suffix and realize that tiles_en.xml and tiles.xml are related. You may run into trouble if you're using more underscores in your filename, though (like tiles_myapp_en.xml and tiles_myapp.xml). On 01/14/2016 02:07 AM, Lukasz Lenart wrote: > Because I want to have wildcard support without using Tiles wildcard > servlet which is based on Spring > > https://github.com/apache/struts/pull/73/files#diff-a4ef02a35b4a5838b0cc73fa5e6236f9R45 OK. I don't know what's wrong with spring. I can see a couple of things wrong with the implementation you're proposing, though: - The existence of an ApplicationResource instance implies that the file exists. I think that your StrutsWildcardServletApplicationContext fullfills that requirement. Therefore you shouldn't have to test for the existence of the file in getInputStream(). Tiles certainly expects this method never to return null. - Reliance on the existence of a physical File: many servlet containers have issues with that, depending their configuration. I can think of tomcat, jetty, jboss, weblogic, websphere (you can configure tomcat and jetty for not unpacking the wars, and I think the last 3 use a Virtual File Structure). That's what I like the most with the spring-based solution: those guys have ironed out this kind of problems :) Overall I think URLApplicationResource is a better fit for you than your custom implementation, since the XWorks ResourceFinder returns URLs. Hope this helps. Nick.