HTML5 Localstorage access using Java

风流意气都作罢 提交于 2019-12-23 18:45:58

问题


Is it possible to access localstorage object using Java directly? If yes how?

Update: I am aware that localstorage is client side and java is server side but I read on net that GWT have api that allow to read localstorage.


回答1:


The local storage, as its name indicates, stores information locally, which means in the browser, at client-side. The servlet filter executes at server-side. There is no way to access the local storage at server-side.

If you need to access some ID stored in the local storage from a servlet filter, then retrieve this ID from the local storage in JavaSCript, and send a request containing this ID to the server.




回答2:


Localstorage is better alternative thamn Cookie. So, I am waiting JAVA support without external library for accessing local web storage, too. Now I am using sellenium support. Please, look at https://gist.github.com/dariodiaz/5079695



来源:https://stackoverflow.com/questions/13217423/html5-localstorage-access-using-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!