Grails 2.3.0视图渲染问题 [英] Grails 2.3.0 view rendering issue

查看:62
本文介绍了Grails 2.3.0视图渲染问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Grails应用程序遇到一个奇怪的问题.似乎错误地缓存了视图.发生的情况是,当我第一次使用特定动作(例如/controller/index)击中路径时,它将为该控制器加载正确的索引视图.现在,当我转到/anotherController/index时,将调用正确的控制器,但它仍尝试为旧索引gsp服务,从而导致明显的*NotFound异常.

I am having a strange issue with my Grails application. It seems that it's caching the views incorrectly. What is happening, is that the first time I hit a path with a specific action (let's say /controller/index) it will load the correct index view for that controller. Now, when I go to /anotherController/index, the correct controller is called, but it still tried to serve the old index gsp, resulting in obvious *NotFound exceptions.

所有视图都会发生这种情况.将为所有后续的具有相同名称的操作显示第一个被加载的内容. IE.调用get的第一个show是正确的,但是随后另一个域对象的任何其他放映尝试使用旧的.

This happens with all views. The first one that get's loaded gets displayed for all subsequent actions with the same name. I.e. the first show that get's called will be correct, but then any other show for another domain object tries to use the old one.

有什么建议吗?我的代码目前几乎是标准的generate-all版本.

Any suggestions? My code is pretty much the stock standard generate-all versions at the moment.

我也应该说,在开发模式下运行可以100%运行. Tomcat 7.0.42中的产品大战正在解决这个问题.

I should also say, running in dev mode works 100%. Prod war in tomcat 7.0.42 is giving the issues.

推荐答案

几周前,我遇到了一个奇怪的问题,但是它正在缓存数据库中的某些信息,并且未返回正确的结果.

I had a weird issue like this a few weeks ago, but it was caching some information from the database and was not returning the correct results.

这是我所做的:

  1. Tomcat停止
  2. 删除了Tomcat的Temp目录中的所有文件
  3. 重新启动Tomcat

之后,它运行良好.

让我知道这是否有帮助.

Let me know if this helps.

这篇关于Grails 2.3.0视图渲染问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆