Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 496055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:39:00+00:00 2026-05-13T05:39:00+00:00

In my Grails GSP file I’m using the HTML meta tag: <meta http-equiv=Content-Type content=text/html;

  • 0

In my Grails GSP file I’m using the HTML meta tag:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

The problem is that Grails closes this tag and renders it as:

<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>

This fails W3C’s HTML validation (since my doctype is HTML and not XHTML).
Is there a fix for this? How can I get Grails to not interpret the
meta tag?

I’m using grails-1.2-M4.

Follow up:
I create the Grails bug GRAILS-5696 for this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:39:00+00:00Added an answer on May 13, 2026 at 5:39 am

    Not sure that this is the most beautiful solution, but at least it will work for your case:

    <%= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">' %>
    

    Well…this does not work since it is preprocessed by Grails before displayed as is.

    So the only solution I see is to create a TagLib and output the content like this:

    class MetaTagLib {
    
        static namespace = 'my'
    
        def meta = {
            out << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>"
        }
    }
    

    and use it like:

    <my:meta />
    

    It works. Tested.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Grails' GSP <g:set> tag, is it possible to specify the type of the
In grails, I use a GSP template to render an HTML email sent out
I'm using a Grails plugin for ajax upload, http://grails.org/plugin/ajax-uploader , that is directly based
I'm trying to display a jQuery FullCalendar (http://arshaw.com/fullcalendar) inside a Grails GSP and to
I do have this code on my demo.gsp file. But I´m new to grails
I'd like to split my views in Grails into 2 files a .gsp file
I want to upload an image using a groovy on grails. My gsp page
I need to find out the physical path of a grails GSP file. My
I'm Using Grails 1.2.1, Groovy 1.7.7. For this line of code in a GSP
I had the following in the <head> of a GSP <script type=text/javascript> $(button.remove-item).click(function() {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.