SWFUpload 和 Java:会话丢失

发布于 2024-07-27 13:34:41 字数 160 浏览 6 评论 0原文

我正在使用 SWFUpload 将文件上传到 java servlet(spring 框架)。 问题是当前的 Web 会话在文件上传期间丢失(它创建了一个新会话)。 我读到这是一个已知的错误,并且在某处有一些解决方法,但我找不到任何东西。 有谁知道如何让它发挥作用?

谢谢。

I am using SWFUpload to upload files to java servlet (spring framework). The problem is that the current web session is lost during file upload (it creates a new session). I read that it is a known bug and there are some workarounds somewhere but I can't find anything. Does anyone know how to make it work?

Thanks.

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

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

发布评论

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

评论(3

巡山小妖精 2024-08-03 13:34:42

您描述的已知错误听起来像这个。 如果您有时间,请注册并表示“我也遇到这个问题”,以便我们可以向 Adob​​e 明确表示该问题正在影响很多人。

由于我对 Spring 不太了解,因此很难针对您的特定情况给出最佳方法的示例。

也就是说,解决这个问题的通常方法是将 GET 变量和会话附加到上传 URL,然后手动将其设置为服务器端的会话。

这是关于这个问题的另一个SO线程,它有一个很好的答案(不幸的是不是特定于java+spring,但可能会给你一个更好的主意)。

希望这些细节足以让您有一个良好的开端。

The known bug you describe sounds like this one. If you have the time please sign up just to say "I have this problem too" so we can make it really clear to Adobe that it is affecting a lot of people.

It is hard to give an example of the best way to do it for your particular situation as I don't know much about spring.

That said, the usual way to work around it is to append a GET variable with the session to the upload url, then take that and manually set it to be the session on the server-side.

Here's another SO thread about this problem that has a good answer (unfortunately not specific to java+spring, but might give you a better idea).

Hopefully that's enough detail to get you off to a good start.

岁吢 2024-08-03 13:34:41

请查看 SWFUpload 论坛上的这篇文章。 在上传 URL 中添加 ;jsessionid=XXX 可能适合您,也可能不适合; 问题的确切原因似乎尚不清楚。 请注意,Flash 使用 Wininet 堆栈(与 IE 相同),因此如果您使用不同的浏览器,则需要以某种方式将会话 cookie(您的浏览器已知)获取到 IE cookie 中。

Have a look at this post on the SWFUpload forums. Adding ;jsessionid=XXX to the upload URL may work for you, or it may not; the exact cause of the problem appears unclear. Note that Flash uses the Wininet stack (same as IE), so if you are using a different browser you need to somehow get the session cookie (known to your browser) into the IE cookie.

深爱成瘾 2024-08-03 13:34:41

.NET 平台上也有这个。 问题在于 Flash 对象在与 Java 应用程序不同的会话上下文中运行(它实际上被视为新客户端)。 解决所有这些问题的一种方法是有效地让对象发布提交上传回查询字符串所需的任何必要信息。

Had this on the .NET platform as well. The problem is that the Flash Object runs in a different session context than your Java App (it's effectively treated like a new client). One way to get around all of this is to effectively have the object post any necessary information needed to commit the uploads back in the querystring.

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