【问题标题】:GWT FormPanel does not submit the session ID after updating on GWT version 2.4.0GWT FormPanel 在 GWT 版本 2.4.0 上更新后不提交会话 ID
【发布时间】:2012-02-25 05:12:57
【问题描述】:

在我更新 2.4.0 上的 GWT 版本和 1.6.2 上的 GAE 版本后,com.google.gwt.user.client.ui.FormPanel 不再提交jSessionId。当我尝试在现在返回 null 的 servlet-doPost-method 中获取 HttpSession (request.getSession(false)) 时,我发现了这个错误。 在我在appspot.com 上部署的版本中,该应用程序仍在运行。于是我用chrome开发工具分析了post-request,发现jSessionId不是FormPanel提交的:

开发模式:

Request     URL:http://halligalli:8888/_ah/upload/ahJtcDNzdHJlYW1pbmdwbGF5ZXJyGwsSFV9fQmxvYlVwbG9hZFNlc3Npb25fXxhHDA
Request Method:POST
Status Code:302 Found
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:7181438
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryB1bDbQ8YLCAabTG5
Host:halligalli:8888
Origin:http://127.0.0.1:8888
Referer:http://127.0.0.1:8888/Mp3Streaming.html?gwt.codesvr=127.0.0.1:9997
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7
Request Payload
------WebKitFormBoundaryB1bDbQ8YLCAabTG5
Content-Disposition: form-data; name="newBlob"; filename="09Anything new.mp3"
Content-Type: audio/mp3

部署版本:

Request URL:http://***.appspot.com/_ah/upload/AMmfu6ZrLfT_jYLHJKBXRoWX9_DeeYoa3Ob-vY0bbOcAJ3bj9ihT7Wp5yPmM3yjhn2RBpJAE8Pr7fIA8O-rhY8k0ARTy7hyU3GU3Qw4WrTHvXcSJ9mXZndA/ALBNUaYAAAAATyp8A-H7HSFTkl5ekVfXgXOmd3gK2PQ3/
Request Method:POST
Status Code:302 Found
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:7181438
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryXy11Yxjeo1JfdJdq
Cookie:JSESSIONID=KOiv4hx1rqIJ1aZdP8CufQ ◄◄◄◄◄◄◄◄◄◄◄◄◄◄◄◄◄◄◄◄HERE IS THE DIFFERENCE
Host:***.appspot.com
Origin:http://***.appspot.com
Referer:http://***.appspot.com/
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7
Request Payload
------WebKitFormBoundaryXy11Yxjeo1JfdJdq
Content-Disposition: form-data; name="newBlob"; filename="09Anything new.mp3"
Content-Type: audio/mp3

我正在使用FormPanel 上传将存储在GAE Blobstore 中的文件,并且我需要会话对象来获取上传文件的所有者(开发模式中的所有其他RPC 都包含jSessionId)。 有什么建议吗?

谢谢你的期待!

【问题讨论】:

  • 下面的答案对您有帮助吗?如果是,请接受。

标签: google-app-engine gwt blobstore


【解决方案1】:

来自您失败的请求:

Request     URL:http://halligalli:8888/_ah/upload/ahJtcDNzdHJlYW1pbmdwbGF5ZXJyGwsSFV9fQmxvYlVwbG9hZFNlc3Npb25fXxhHDA
[…]
Host:halligalli:8888
Origin:http://127.0.0.1:8888
Referer:http://127.0.0.1:8888/Mp3Streaming.html?gwt.codesvr=127.0.0.1:9997

您没有将请求发送到同一个来源:您的浏览器没有向halligalli 发送为127.0.0.1 设置的cookie。

据我所知,这是开发环境中BlobstoreService 的限制。见GWT Blobstore error calling createUploadUrl()

【讨论】:

    猜你喜欢
    • 2012-10-16
    • 2015-06-18
    • 2018-09-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 1970-01-01
    • 2011-03-31
    • 1970-01-01
    相关资源
    最近更新 更多