Portlet 规范 - 处理异步 Multipart 请求
有人可以告诉我,处理多部分http请求的正确方法是什么,由于它们的异步性质,这些请求不应该是ActionRequest?
例如,来自 Flash 上传器的 Ajax Multipart 请求。它们并不意味着是操作请求,因为操作阶段之后是渲染阶段,对吗?因为如果是 html 形式的话会很方便。
像 Spring 这样的一些框架正在使用 ResourceRequests 来处理常见的 Ajax 请求,但没有提到它处理 Multipart 请求的任何内容(在 JSR 286 中)。
然后剩下的是渲染阶段,它可以用于此目的,但似乎不太正确。在 spring-portlet-mvc 中,在某些情况下实际上无法做到这一点,因为渲染阶段预计渲染视图,而不是异步处理请求。
在 Spring 框架中,存在这些我不知道如何处理的问题
我的最后一点是,异步请求应该由 servlet 处理而不是指向portal servlet 成为portlet 请求,这是相当烦人的并且会导致很多额外的工作。或者,就像在 Spring-portlet-mvc 中一样,使用 ResourceRequests 作为解决方法。
could please anybody tell me, what is the proper way of handling Multipart http requests, that are not supposed to be ActionRequest because of their asynchronous nature ?
For instance, Ajax Multipart requests from flash uploaders. They are not meant to be Action requests because Action phase is followed by render phase right ? As it would be convenient in case of html form.
Some frameworks like Spring are using ResourceRequests for handling common Ajax requests, but there isn't mentioned anything about it handling Multipart requests (in JSR 286).
Then what remains is Render phase, which could be used for that, but it doesn't seem to be right. In spring-portlet-mvc there is practically no way to do that in some cases, because render phase is expected to render a view, not handle requests asynchronously.
In spring framework there are then these issues that I don't know how to deal with
My final though is, that Asynchronous requests should be handled by a servlet and not pointed to portal servlet to become a portlet requests, which is quite annoying and it causes lot of extra work. Or, as it is in Spring-portlet-mvc, use ResourceRequests as a workaround.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我已经在此处概括地解释了这个问题。
在 Liferay 门户中,您还必须在操作请求中指定 windowState="exclusive" 参数。
它导致响应不会被一些 html 片段包装,否则渲染响应时需要这些片段,这些片段不返回原始数据,而是返回一些要渲染的视图 (JSP)。
Well I already explained this question here, in general terms.
In Liferay portal you have to also specify windowState="exclusive" parameter in your action request.
It causes that the response won't be wrapped by some html fragments that would otherwise be needed in case of a render response, that doesn't return raw data but some View (JSP) to be rendered.