Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 77995200B65 for ; Wed, 17 Aug 2016 15:36:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 76412160ABE; Wed, 17 Aug 2016 13:36:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BE889160A6C for ; Wed, 17 Aug 2016 15:36:29 +0200 (CEST) Received: (qmail 72798 invoked by uid 500); 17 Aug 2016 13:36:28 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 72789 invoked by uid 99); 17 Aug 2016 13:36:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Aug 2016 13:36:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C38B3DFBD7; Wed, 17 Aug 2016 13:36:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lukaszlenart@apache.org To: commits@struts.apache.org Date: Wed, 17 Aug 2016 13:36:28 -0000 Message-Id: <4dc9cd4dd9f3403bb8ab71f9d464334b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] struts git commit: Disables params evaluation when creating results by convention archived-at: Wed, 17 Aug 2016 13:36:30 -0000 Repository: struts Updated Branches: refs/heads/support-2-3 7d8c3598e -> 030ffa335 Disables params evaluation when creating results by convention Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/030ffa33 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/030ffa33 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/030ffa33 Branch: refs/heads/support-2-3 Commit: 030ffa33543f8953306ed0c0dc815c7fb74d7129 Parents: 8e67b91 Author: Lukasz Lenart Authored: Wed Aug 17 15:35:43 2016 +0200 Committer: Lukasz Lenart Committed: Wed Aug 17 15:36:20 2016 +0200 ---------------------------------------------------------------------- .../convention/ConventionsServiceImpl.java | 26 ++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/030ffa33/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java ---------------------------------------------------------------------- diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java index 56815a6..6e5abda 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java @@ -107,14 +107,26 @@ public class ConventionsServiceImpl implements ConventionsService { public Map getResultTypesByExtension(PackageConfig packageConfig) { Map results = packageConfig.getAllResultTypeConfigs(); + ResultTypeConfig dispatcher = disableParse(results.get("dispatcher")); + ResultTypeConfig velocity = disableParse(results.get("velocity")); + ResultTypeConfig freemarker = disableParse(results.get("freemarker")); + Map resultsByExtension = new HashMap(); - resultsByExtension.put("jsp", results.get("dispatcher")); - resultsByExtension.put("jspf", results.get("dispatcher")); - resultsByExtension.put("jspx", results.get("dispatcher")); - resultsByExtension.put("vm", results.get("velocity")); - resultsByExtension.put("ftl", results.get("freemarker")); - resultsByExtension.put("html", results.get("dispatcher")); - resultsByExtension.put("htm", results.get("dispatcher")); + resultsByExtension.put("jsp", dispatcher); + resultsByExtension.put("jspf", dispatcher); + resultsByExtension.put("jspx", dispatcher); + resultsByExtension.put("vm", velocity); + resultsByExtension.put("ftl", freemarker); + resultsByExtension.put("html", dispatcher); + resultsByExtension.put("htm", dispatcher); return resultsByExtension; } + + private ResultTypeConfig disableParse(ResultTypeConfig resultConfig) { + if (resultConfig != null) { + return new ResultTypeConfig.Builder(resultConfig).addParam("parse", "false").build(); + } + return null; + } + }