Spring Roo
  1. Spring Roo
  2. ROO-1907

Set content type to text/html in all generated jspx pages to allow use of other Templating frameworks besides Tiles

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Complete
    • Affects Version/s: 1.1.0.RELEASE, 1.1.1.RELEASE, 1.1.2.RELEASE, 1.1.3.RELEASE, 1.2.0.RC1
    • Fix Version/s: 1.1.1.RELEASE
    • Component/s: WEB MVC
    • Labels:
      None
    • Environment:
      Sitemesh 2.4.2

      Description

      I have created a Roo Sitemesh addon that works out of the box with the existing generated pages.

      The only problem I am having is that because the pages are jspx and rendered directly, Tomcat renders the pages as text/xml.

      I need the following jsp:directive:
      <jsp:directive.page contentType="text/html;charset=UTF-8" />
      in all jspx pages.

      I would suggest placing this above the
      <jsp:output omit-xml-declaration="yes" />
      tag that is already in every jspx page.

      Adding the directive to all jspx pages will have no impact on the existing Tiles application.

      This problem does not happen with Tiles because this directive is already in the default.jspx layout which is compositely rendered.

      Sitemesh uses the decorator pattern and because the pages have already been rendered with the content type set, I can not change the content type in the decorator.

        Activity

        Hide
        Stefan Schmidt added a comment -

        Hi Scott,

        Commit a1812b85fdee83aad396b4ade70ae97ad52e9641 now includes the content type directive for all jspx pages.

        I have changed the issue type to the more appropriate improvement type given it was working as designed given that users would seldom use Tiles and Sitemesh in conjunction.

        Anyway, if this is all it takes to get it working I am happy to make the necessary changes.

        Are you planning to make this add-on publicly available? If so you should consider publishing it through RooBot. Let me know if you need any help on this.

        Cheers,
        Stefan

        Show
        Stefan Schmidt added a comment - Hi Scott, Commit a1812b85fdee83aad396b4ade70ae97ad52e9641 now includes the content type directive for all jspx pages. I have changed the issue type to the more appropriate improvement type given it was working as designed given that users would seldom use Tiles and Sitemesh in conjunction. Anyway, if this is all it takes to get it working I am happy to make the necessary changes. Are you planning to make this add-on publicly available? If so you should consider publishing it through RooBot. Let me know if you need any help on this. Cheers, Stefan
        Hide
        Scott Murphy added a comment -

        Thanks Stefan,

        Yes, I plan on publishing it through RooBot when it is done. I verified this fix and it works great.

        I am still waiting on ROO-1908. In order for the error pages to have a decorator applied to them, I need to add an ERROR dispatcher tag with the filter mapping.

        Show
        Scott Murphy added a comment - Thanks Stefan, Yes, I plan on publishing it through RooBot when it is done. I verified this fix and it works great. I am still waiting on ROO-1908 . In order for the error pages to have a decorator applied to them, I need to add an ERROR dispatcher tag with the filter mapping.

          People

          • Assignee:
            Stefan Schmidt
            Reporter:
            Scott Murphy
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: