Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.10
    • Fix Version/s: 3.0
    • Component/s: Plugin - Tags
    • Labels:
      None

      Description

      There are a number of issues regarding themes that need to be addressed. All of these issues stem from the fact that Struts2 allows a property to move the location of the theme overrides from /template to anywhere within the web application. Setting it to something like this causes nothing to work at all.

      struts.ui.templateDir=/WEB-INF/template

      The first issue is that overrides no longer work because this directory is assumed to be the directory for ALL templates including the base template being overridden. All path variables no longer work and the theme no does not pick up templates from its parent.

      The second issue is that some variables are no longer being set, such as the themeProperties.parent. This is obviously due to the directory problem, but effects every template file.

      So, for all intents and purposes, this configuration parameter doesn't work at all.

        Issue Links

          Activity

          Brian Pontarelli created issue -
          Ted Husted made changes -
          Field Original Value New Value
          Fix Version/s 2.1.0 [ 21794 ]
          Hide
          Don Brown added a comment -

          If you extract all the templates and their related files from the jar and moved them to this directory, does it work correctly? It could be argued that a production application should do that anyways to ensure top performance. What do you think the resolution of this issue should be?

          Show
          Don Brown added a comment - If you extract all the templates and their related files from the jar and moved them to this directory, does it work correctly? It could be argued that a production application should do that anyways to ensure top performance. What do you think the resolution of this issue should be?
          Hide
          Brian Pontarelli added a comment -

          I'm not certain that I agree with the production argument. That is because of a FreeMarker problem with caching correct? In most cases I feel that production applications should be able to define ONLY the template they are using and not be forced to pull in the hierarchy of templates they depend on. This also makes sense for component architectures where components will ship their view objects (FreeMarker templates probably) as well as the template/themes they will be using for their forms.

          Therefore, I would expect that this would allow a template to be defined partially or fully within the project and everything else to be defined within JAR files. Furthermore, if there truly is a large performance hit with FreeMarker templates inside JAR files, I feel that needs to be fixed as well.

          Of course, this is all mainly due to my work with Smart URLs plugin and building a component framework on top of Struts.

          Show
          Brian Pontarelli added a comment - I'm not certain that I agree with the production argument. That is because of a FreeMarker problem with caching correct? In most cases I feel that production applications should be able to define ONLY the template they are using and not be forced to pull in the hierarchy of templates they depend on. This also makes sense for component architectures where components will ship their view objects (FreeMarker templates probably) as well as the template/themes they will be using for their forms. Therefore, I would expect that this would allow a template to be defined partially or fully within the project and everything else to be defined within JAR files. Furthermore, if there truly is a large performance hit with FreeMarker templates inside JAR files, I feel that needs to be fixed as well. Of course, this is all mainly due to my work with Smart URLs plugin and building a component framework on top of Struts.
          James Holmes made changes -
          Link This issue is duplicated by WW-1961 [ WW-1961 ]
          Hide
          musachy added a comment -

          Just to add to this, there is a new property that provides caching on the FreeMarker templates

          Show
          musachy added a comment - Just to add to this, there is a new property that provides caching on the FreeMarker templates
          Hide
          James Holmes added a comment -

          Brian, I agree with you that the production argument doesn't hold. In my opinion the problem is that you can override individual template files if you use the default template directory and it works fine. However, it breaks when you specify a different directory. I think it is reasonale to expect the same "template overriding" behavior regardless of the directory where templates are loaded from.

          Moving to 2.0.10.

          Show
          James Holmes added a comment - Brian, I agree with you that the production argument doesn't hold. In my opinion the problem is that you can override individual template files if you use the default template directory and it works fine. However, it breaks when you specify a different directory. I think it is reasonale to expect the same "template overriding" behavior regardless of the directory where templates are loaded from. Moving to 2.0.10.
          James Holmes made changes -
          Fix Version/s 2.1.0 [ 21794 ]
          Fix Version/s 2.0.10 [ 21850 ]
          Rene Gielen made changes -
          Link This issue relates to WW-1661 [ WW-1661 ]
          Hide
          Rene Gielen added a comment -

          This is the freemarker caching feature issue Musachy mentioned

          Show
          Rene Gielen added a comment - This is the freemarker caching feature issue Musachy mentioned
          Hide
          Brian Pontarelli added a comment -

          Just to wanted to make sure we are all on the same page. This is a caching issue and an override issue. They both need to be addressed to fully support the intended FreeMarker templating.

          Show
          Brian Pontarelli added a comment - Just to wanted to make sure we are all on the same page. This is a caching issue and an override issue. They both need to be addressed to fully support the intended FreeMarker templating.
          Hide
          James Holmes added a comment -

          Agreed Brian. To me the main issue though is the overriding.

          Show
          James Holmes added a comment - Agreed Brian. To me the main issue though is the overriding.
          Jeff Turner made changes -
          Workflow Struts [ 41149 ] Struts - editable closed status [ 44068 ]
          Hide
          James Holmes added a comment -

          Moving to 2.0.11 in preparation for 2.0.10 release.

          Show
          James Holmes added a comment - Moving to 2.0.11 in preparation for 2.0.10 release.
          James Holmes made changes -
          Affects Version/s 2.0.8 [ 21801 ]
          Fix Version/s 2.0.10 [ 21850 ]
          Affects Version/s 2.0.10 [ 21850 ]
          Fix Version/s 2.0.11 [ 21860 ]
          Affects Version/s 2.0.9 [ 21832 ]
          Affects Version/s 2.0.7 [ 21796 ]
          James Holmes made changes -
          Fix Version/s 2.0.11 [ 21860 ]
          Fix Version/s 2.0.12 [ 21861 ]
          Hide
          Don Brown added a comment -

          The real issue here is you want to be able to override templates, but that isn't in the current design of the theme engine. The struts.ui.templateDir setting is simply meant to customize where it looks for all the templates. I updated the docs to clarify its purpose and changed this ticket to an enhancement to properly reflect its purpose.

          Show
          Don Brown added a comment - The real issue here is you want to be able to override templates, but that isn't in the current design of the theme engine. The struts.ui.templateDir setting is simply meant to customize where it looks for all the templates. I updated the docs to clarify its purpose and changed this ticket to an enhancement to properly reflect its purpose.
          Don Brown made changes -
          Summary Template directory config (struts.ui.templateDir) causes all templates to fail completely Support template overriding
          Fix Version/s 2.1.2 [ 21861 ]
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Fix Version/s Future [ 21530 ]
          Don Brown committed 651217 (1 file)
          Reviews: none

          Clarifying purpose of struts.ui.templateDir setting
          WW-1832

          Antonio Petrelli made changes -
          Workflow Struts - editable closed status [ 44068 ] Struts - editable closed status (temporary) [ 46525 ]
          Antonio Petrelli made changes -
          Workflow Struts - editable closed status (temporary) [ 46525 ] Struts - editable closed status [ 49770 ]
          Jeff Turner made changes -
          Project Import Mon Feb 01 01:17:42 UTC 2010 [ 1264987062082 ]
          Lukasz Lenart made changes -
          Fix Version/s 3.x [ 12319158 ]
          Fix Version/s Future [ 12314681 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Brian Pontarelli
            • Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Development