English 中文(简体)
Grails 解释并关闭了超声波塔
原标题:Grails interprets and closes HTML meta tag
  • 时间:2009-12-14 06:32:43
  •  标签:
  • grails
  • gsp

在我的Grails GSP档案中,使用超声波塔号:

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

问题是,Grails关闭了这一十字路口,使其成为:

<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 采用铁路-1.2-M4。

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

最佳回答

这并不是最美好的解决方案,但至少会为你的工作:

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

......这并不奏效,因为在显示之前,它先由铁路公司处理。

因此,我看到的唯一解决办法是建立一个塔吉卜公司,并产生这样的内容:

class MetaTagLib {

    static namespace =  my 

    def meta = {
        out << "<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>"
    }
}

并使用:

<my:meta />

它行之有效。 测试。

问题回答




相关问题
grails + gwt request handling via controllers

I am new to gwt. I am trying to integrate gwt+grails.Can anybody provide me a good example for handling the request using grails controllers and not a custom servlet.I will be really thankful if ...

Error loading the grails gwt module xml

I ve installed the plugin from this article by Peter http://www.cacoethes.co.uk/blog/groovyandgrails/the-command-pattern-w.... While compile time its not able to find the module file which is present ...

Sorting Objects Based on Custom Domain Class Methods

I have a domain class, in which I ve defined some methods which give the object a score based on different algorithms (eg. popularity). I now want to retrieve a list of these objects sorted by one of ...

Grails Packaging and Naming Conventions

Packaging Controllers, Services,etc. i.e. - com.company.controllers - com.company.services Is this a good practice or should be avoided by all means?? Another worth mentioning problem I encountered ...

Hibernate/GORM: collection was not processed by flush()

I have an integration test in my Grails application that fails when I try to save an entity of type Member invitingMember.save(flush: true) This raises the following exception org.hibernate....

热门标签