Grails 1.0.3控制台报告"文件过早结束"
时间:2020-03-06 14:44:59 来源:igfitidea点击:
浏览到使用Grails 1.0.3版构建的动态网页时,控制台日志针对每个页面请求显示以下错误:
[Fatal Error] :-1:-1: Premature end of file.
如何阻止此错误出现在每个请求中?
解决方案
该错误已修复:
http://jira.codehaus.org/browse/GRAILS-3088
Premature end of file Affects Version/s: 1.0.3 Fix Version/s: 1.0.4 ...Just a few implementation notes. We were defaulting to a q value of 0, which is incorrect according to the spec. So we now default to 1.0 which gives the correct precedence order in Firefox 3, but incorrect in Firefox 2. However, more specific XML types like application/xhtml+xml now take precendence over less specific ones if they have the same q value so this fixes the issue in Firefox 2...
当从Firefox 3浏览器发出http请求时,将出现日志条目。
Grails 1.0.3的解决方法是在项目中打开Config.groovy并找到以下内容:
grails.mime.types = [ html: ['text/html','application/xhtml+xml'], xml: ['text/xml', 'application/xml'], ...
上面与xml有关的第二行应删除。
这是已解决的GRAILS 1.0.3错误,有关完整详细信息,请参见http://jira.codehaus.org/browse/GRAILS-3088.
升级到1.0.4快照可能是解决此问题的最佳方法。在Grails下载页面的" Grails开发版本"下查看说明。
也可以毫不费力地忽略它。