Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A53EA10D89 for ; Wed, 9 Apr 2014 14:26:43 +0000 (UTC) Received: (qmail 12572 invoked by uid 500); 9 Apr 2014 14:26:39 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 10482 invoked by uid 500); 9 Apr 2014 14:26:33 -0000 Mailing-List: contact issues-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 issues@struts.apache.org Received: (qmail 9989 invoked by uid 99); 9 Apr 2014 14:26:31 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2014 14:26:31 +0000 Date: Wed, 9 Apr 2014 14:26:30 +0000 (UTC) From: "Steven James (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (WW-4319) struts2-jquery-plugin custom tag templates broken MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Steven James updated WW-4319: ----------------------------- Attachment: struts2-example-0.0.1-project.zip Maven demo app > struts2-jquery-plugin custom tag templates broken > ------------------------------------------------- > > Key: WW-4319 > URL: https://issues.apache.org/jira/browse/WW-4319 > Project: Struts 2 > Issue Type: Bug > Affects Versions: 2.3.16.1 > Environment: Struts 2.3.16.1, struts2-jquery-plugin 3.7.0, tomcat v7.0 > Reporter: Steven James > Attachments: struts2-example-0.0.1-project.zip > > > Hi, > I am developing an application which has been predominantly written with Struts2 version 2.3.15.3 and the struts2-jquery-plugin version 3.6.1. > I have recently upgraded to Struts2 version 2.3.16.1 and struts2-jquery-plugin version 3.7.0. > The application has used the css_xhtml theme throughout, defined in struts.xml. > Since the upgrade, the HTML markup of the struts2-jquery-plugin ( sj: ) components has been adversly affected. > I have debugged the application and found that the issue is caused by the changes made to themes under WW-4145. > The situation appears to be this: > The struts2-jquery-plugin has implemented custom tags for their components and these classes will return the value of 'jquery' in response to the getTheme() method. They do appear to correctly store a 'parentTheme' parameter with the correct value (in my case from the parent form element) of 'css_xhtml'. > The struts2-jquery-plugin custom templates are successfully found on the templates/jquery path, but some of them contain 'include' statements, for example, the datepicker.ftl contains the following snippet: > {code:xml} > <#if parameters.parentTheme == 'css_xhtml'> > <#include "/${parameters.templateDir}/css_xhtml/controlheader.ftl" /> > > {code} > So, at this point, all is well, the correct controlheader.ftl template for the css_xhtml theme is found and included, however this template (now) contains the following include: > {code:xml} > <#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader-core.ftl"> > {code} > And this is where it starts to go wrong. The {noformat}${parameters.expandTheme}{noformat} resolves to '~~~jquery' and, after reading the WW-4145 change info, I understand that this will cause the ThemeManager to load the template from the parent theme as defined in the theme.properties file. This, in the case of the struts2-jquery-plugin, is defiend as 'xhtml' and NOT 'css_xhtml' as discovered from the parent form component. Consequently, the wrong controlheader-core.ftl template is included, and the resulting HTML includes incorrect and tags which ultimately break the page. > > Other than hacking the templates, I cannot see a satisfactory way of resolving this problem, so any assistance would be gratefully received. > > Thanks > Steve -- This message was sent by Atlassian JIRA (v6.2#6252)