简体   繁体   English

用于Android / iOS的HTML5应用程序的JSP / Servlet会话

[英]JSP/Servlet session for HTML5 apps packaged for Android/iOS

I am developing a HTML5 app using the Sencha framework that works against JSPs on the backend. 我正在使用Sencha框架开发一个HTML5应用程序,该框架可在后端与JSP一起使用。 I plan to package this into Android and iOS native app for distribution (thinking of PhoneGap or Sencha Cmd). 我计划将其打包到Android和iOS本机应用程序中进行分发(以考虑PhoneGap或Sencha Cmd)。

My app sometimes opens a new browser window for users to complete authorizations with oauth, then users return to the app. 我的应用程序有时会打开一个新的浏览器窗口,供用户使用oauth完成授权,然后用户返回到该应用程序。 During this, I store some temp data in the session. 在此期间,我在会话中存储了一些临时数据。

My question is that in the case of HTML5 apps packaged as native Android and iOS apps, when the app launches a new browser window and does some activity (like authorization) that places temp data in the session, then closes the window and returns to the app, does the app have access to those session objects? 我的问题是,在将HTML5应用程序打包为本机Android和iOS应用程序的情况下,当该应用程序启动新的浏览器窗口并执行一些活动(如授权)时,将临时数据放入会话中,然后关闭该窗口并返回到应用程序,该应用程序有权访问这些会话对象吗? If the app then invokes JSPs, can the JSPs access the session objects that were placed by the browser window that was opened and closed previously? 如果应用程序随后调用JSP,则JSP是否可以访问由先前打开和关闭的浏览器窗口放置的会话对象?

I hope my question is clear. 希望我的问题清楚。 Let me know if I can provide any further clarifications. 让我知道是否可以提供进一步的说明。 As always, any help or advice is greatly appreciated! 与往常一样,任何帮助或建议都将不胜感激!

Thanks! 谢谢!

I think that is not possible. 我认为那是不可能的。

But.. 但..

Consider that most of the oauth services returns a token to the redirect-url as a param. 请考虑大多数oauth服务将令牌作为参数返回到重定向URL。 So, If you are planning to use Phonegap/Cordova, and in that case you probably want to use the inAppBrowser plugin.. you could listen to the url changes and extract the token from it. 因此,如果您打算使用Phonegap / Cordova,并且在那种情况下,您可能想要使用inAppBrowser插件。您可以侦听url的更改并从中提取令牌。

Hope it helps- 希望能帮助到你-

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM