Grails GSP 不会在 Geronimo 下生成预期的 HTML
当在 Geronimo 2.1.4(jetty6、javaee5)下将我的 Grails 1.1-M2 应用程序作为 WAR 运行时,从 GSP 生成的 HTML 不包含我的动态内容。
具体来说,这个 GSP 片段:
<tr class="prop">
<td valign="top" class="name">
<label for="type">
<g:message code="album.type.label" default="Type" />
</label>
</td>
<td valign="top" class="value ${hasErrors(bean:albumInstance,field:'type','errors')}">
<g:select from="${AlbumType?.values()}" value="${albumInstance?.type}" name="type" ></g:select>
</td>
</tr>
...在 Geronimo 下运行时生成此 HTML:
<tr class="prop">
<td valign="top" class="name">
<label for="type">
Type
</label>
</td>
<td valign="top" class="value ">
<select name="type" id="type" ></select>
</td>
</tr>
...但是,当作为“grails run-app”或“grails run-war”运行时,会生成正确的 HTML:
<tr class="prop">
<td valign="top" class="name">
<label for="type">
Type
</label>
</td>
<td valign="top" class="value ">
<select name="type" id="type" >
<option value="EP" >EP</option>
<option value="LP" >LP</option>
<option value="SINGLE" >SINGLE</option>
</select>
</td>
</tr>
定义了 AlbumType.groovy在 src/groovy 中为:
public enum AlbumType {
EP,
LP,
SINGLE
}
我已经打开了 Grails 中的所有日志记录,并且没有看到任何错误或异常。这个问题很令人困惑,因为我只在 Geronimo 下运行 Grails WAR 时看到它。当然,我还没有尝试过任何其他应用程序服务器,但奇怪的是,“grails run-app”和“grails run-war”一切都运行良好。
对这个问题有什么想法吗?
When running my Grails 1.1-M2 app as a WAR under Geronimo 2.1.4 (jetty6, javaee5), the HTML generated from the GSPs do not include my dynamic content.
Specifically, this GSP snippet:
<tr class="prop">
<td valign="top" class="name">
<label for="type">
<g:message code="album.type.label" default="Type" />
</label>
</td>
<td valign="top" class="value ${hasErrors(bean:albumInstance,field:'type','errors')}">
<g:select from="${AlbumType?.values()}" value="${albumInstance?.type}" name="type" ></g:select>
</td>
</tr>
...produces this HTML when running under Geronimo:
<tr class="prop">
<td valign="top" class="name">
<label for="type">
Type
</label>
</td>
<td valign="top" class="value ">
<select name="type" id="type" ></select>
</td>
</tr>
...however when running as 'grails run-app' or 'grails run-war', this, correct HTML is produced:
<tr class="prop">
<td valign="top" class="name">
<label for="type">
Type
</label>
</td>
<td valign="top" class="value ">
<select name="type" id="type" >
<option value="EP" >EP</option>
<option value="LP" >LP</option>
<option value="SINGLE" >SINGLE</option>
</select>
</td>
</tr>
AlbumType.groovy is defined in src/groovy as:
public enum AlbumType {
EP,
LP,
SINGLE
}
I've turned on all logging within Grails and don't see any error or exceptions. This issue is confusing as I only see it while running my Grails WAR under Geronimo. Granted, I haven't tried any other app servers though it is curious that everything works fine with 'grails run-app' and 'grails run-war'.
Any ideas as to the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我强烈建议将代码保留在默认包之外,并将其放入良好的包结构中。我怀疑这是你的问题。
I would highly recommend keeping code out of the the default package and putting it into a good package structure. I suspect this is your issue.