DWR +春天 + JPA 会议结束

发布于 2024-08-08 04:18:04 字数 499 浏览 4 评论 0原文

背景

我正在开发的应用程序当前使用 Spring + JPA。在我们决定引入 DWR 之前,一切都运行良好。

我使用 DWR 调用服务类上的一个方法,然后它重定向到控制器。

try{
      return WebContextFactory.get()
                        .forwardToString("/search.do?searchString=" + searchString);
}catch(...){

}

此后,当在 DAO 中调用搜索方法时,它找不到笔会话。

Session session = (Session) entityManager.getDelegate();

这里的会话已关闭...

我认为我的更改(引入 DWR)不应以任何方式影响会话创建。

等待输入。

沙杜尔。

Background

The application I am working on currently uses Spring + JPA. Everything was working fine before we decided to introduce DWR.

Using DWR I invoke a method on a Service class and it then redirects to the Controller.

try{
      return WebContextFactory.get()
                        .forwardToString("/search.do?searchString=" + searchString);
}catch(...){

}

After this, when the search method is invoked at the DAO, it does not find an pen session.

Session session = (Session) entityManager.getDelegate();

This session here is closed...

I think my changes(of introducing DWR) should not in any way affect the Session creation.

Awaiting inputs.

Shardul.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光是把杀猪刀 2024-08-15 04:18:04

问题已解决。

问题在于 web.xml 中 OpenEntityManagerInViewFilter 的配置。它没有拦截 DWR 请求,因为它被映射到

*.do

代替

/*

沙杜尔。

Issue resolved.

The problem was with the configuration of OpenEntityManagerInViewFilter in the web.xml. It was not intercepting the DWR requests as it was mapped to a

*.do

instead of

/*

Shardul.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文