Skip to content

Commit 14ab1b2

Browse files
author
graeme
committed
fixed again. grailsWebRequest needs to go before the sitemesh filter
git-svn-id: https://svn.codehaus.org/grails/trunk@2974 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d
1 parent 3e5036b commit 14ab1b2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/groovy/org/codehaus/groovy/grails/web/plugins/ControllersGrailsPlugin.groovy

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ class ControllersGrailsPlugin {
165165

166166
def lastFilter = filters[filters.size()-1]
167167
def lastFilterMapping = filterMappings[filterMappings.size()-1]
168+
def charEncodingFilter = filterMappings.find { it.'filter-name'.text() == 'charEncodingFilter'}
168169

169170
// add the Grails web request filter
170171
lastFilter + {
@@ -179,12 +180,18 @@ class ControllersGrailsPlugin {
179180
}
180181
}
181182
}
182-
lastFilterMapping + {
183+
def grailsWebRequestFilter = {
183184
'filter-mapping' {
184185
'filter-name'('grailsWebRequest')
185186
'url-pattern'("/*")
186187
}
187-
}
188+
}
189+
if(charEncodingFilter) {
190+
charEncodingFilter + grailsWebRequestFilter
191+
}
192+
else {
193+
lastFilterMapping + grailsWebRequestFilter
194+
}
188195
// if we're in development environment first add a the reload filter
189196
// to the web.xml by finding the last filter and appending it after
190197
if(grailsEnv == "development") {

0 commit comments

Comments
 (0)