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

          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.
          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.
          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.
          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.
          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.

            People

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

              Dates

              • Created:
                Updated:

                Development