Details
-
Type:
Sub-task
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.2-M1
-
Fix Version/s: 2.3-M2
-
Component/s: View technologies
-
Labels:None
Description
Like any sane person, I want my XHTML pages to be served with the application/xhtml+xml MIME type to browsers that support it and as text/html to the rest. However, Grails seems to serve GSPs as text/html unless response.setContentType() is explicitly called. Is that right? As a workaround, I've added
<g:if test="${header(name: 'accept')?.contains('application/xhtml+xml')}"> <% response.setContentType('application/xhtml+xml') %> </g:if><g:else> <% response.setContentType('text/html') %> </g:else>
to the top of all of my GSPs. This seems to work. But I'd think that the logical place to put this rule would be in Config.groovy, with the other MIME types. Something like
grails.mime.types = [ html: ['text/html', 'application/xhtml+xml'], gsp: ['text/html', 'application/xhtml+xml'], xml: ['text/xml', 'application/xml'], ...]
which, currently, has no apparent effect. Or is there something simpler I'm overlooking?
Activity
Graeme Rocher
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | 2.0 [ 15421 ] |
Graeme Rocher
made changes -
| Assignee | Graeme Rocher [ graemerocher ] |
Contegix Support
made changes -
| Project Import | Thu Mar 24 21:22:24 CDT 2011 [ 1301019744151 ] |
Burt Beckwith
made changes -
| Workflow | jira [ 33689 ] | Grails [ 40581 ] |
Burt Beckwith
made changes -
| Workflow | Grails [ 40581 ] | Copy of Grails [ 48012 ] |
Burt Beckwith
made changes -
| Workflow | Copy of Grails [ 48012 ] | Grails [ 55422 ] |
Burt Beckwith
made changes -
| Workflow | Grails [ 55422 ] | Grails2 [ 62970 ] |
Burt Beckwith
made changes -
| Workflow | Grails2 [ 62970 ] | jira [ 77023 ] |
Burt Beckwith
made changes -
| Workflow | jira [ 77023 ] | Grails2 [ 79721 ] |
Peter Ledbrook
made changes -
| Last Reviewed | 01/Jan/10 |
Peter Ledbrook
made changes -
| Workflow | Grails2 [ 79721 ] | jira [ 88939 ] |
Peter Ledbrook
made changes -
| Workflow | jira [ 88939 ] | Grails2 [ 97205 ] |
Graeme Rocher
made changes -
| Fix Version/s | 2.1 [ 12801 ] | |
| Fix Version/s | 3.0 [ 11042 ] |
Graeme Rocher
made changes -
| Fix Version/s | 2.1 [ 13117 ] | |
| Fix Version/s | 2.1-RC1 [ 12801 ] |
Graeme Rocher
made changes -
| Fix Version/s | 2.1 [ 13125 ] | |
| Fix Version/s | 2.1-RC2 [ 13117 ] |
Graeme Rocher
made changes -
| Fix Version/s | 2.1 [ 13133 ] | |
| Fix Version/s | 2.1-RC3 [ 13125 ] |
Graeme Rocher
made changes -
| Fix Version/s | 2.2 [ 13093 ] | |
| Fix Version/s | 2.1 [ 13133 ] |
Graeme Rocher
made changes -
| Fix Version/s | 2.3 [ 13311 ] | |
| Fix Version/s | 2.2-RC1 [ 13093 ] |
Peter Ledbrook
made changes -
| Parent | GRAILS-9888 [ 43881 ] | |
| Issue Type | Improvement [ 4 ] | Sub-task [ 5 ] |
Graeme Rocher
made changes -
| Fix Version/s | 2.3-M2 [ 13457 ] | |
| Fix Version/s | 2.3-M1 [ 13311 ] |
Given the planed additional support for REST in v2.2, and the fact that REST is highly reliant on content types, it would be great if this could be targeted at v2.2 instead of v3.