gpt4 book ai didi

google-app-engine - GWT FormPanel 在 GWT 版本 2.4.0 上更新后不提交 session ID

转载 作者:太空宇宙 更新时间:2023-11-03 15:34:39 28 4
gpt4 key购买 nike

在我更新 2.4.0 上的 GWT 版本和 1.6.2 上的 GAE 版本后,com.google.gwt.user.client.ui.FormPanel 没有提交 jSessionId 了。当我尝试在现在返回 null 的 servlet-doPost 方法中获取 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 中的文件,我需要 session 对象来获取上传文件的所有者(开发模式中的每个其他 RPC 都包含jSessionId)。有什么建议吗?

谢谢你的期待!

最佳答案

来自您失败的请求:

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

您没有将请求发送到相同的 origin:您的浏览器没有向 halligalli 发送已为 127.0.0.1 设置的 cookie

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

关于google-app-engine - GWT FormPanel 在 GWT 版本 2.4.0 上更新后不提交 session ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9114190/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com