Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2745

the gsp template can not support unicode(utf-8)

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.4
    • Fix Version/s: 1.5.5, 1.6-beta-1
    • Component/s: Groovlet / GSP
    • Labels:
      None
    • Environment:
      jdk1.5,Debian/Linux,groovy1.5.4
    • Flags:
      Patch

      Description

      a test gsp file is (chinese encoding):

      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <title>测试页</title>
      </head>
      <body>
      <%
      print "groopvy 测试页"
      %>
      </body>
      </html>

      After browser the groovy.servlet.TemplateServlet source code,I find that the service method only set the ContentType to "text/html" .There no information about encoding.
      So I add the encoding support for it,you can see the attachment(diff format),and you can configure it throgh the web.xml

        Attachments

        1. AbstractHttpServlet.diff
          0.8 kB
          Agile Quemuel
        2. GroovyServlet.diff
          0.6 kB
          Agile Quemuel
        3. TemplateServlet.diff
          0.6 kB
          Agile Quemuel

        Issue Links

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              agile Agile Quemuel

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment