Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 Localstorage access using Java

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.

like image 835
Dev G Avatar asked Nov 04 '12 09:11

Dev G


People also ask

Can we use localStorage in Java?

Local storage refers to the data structures that actually store or cache the data that is managed by Coherence. For an object to provide local storage, it must support the same standard collections interface, java.

Does HTML5 support local storage?

With HTML5 local storage, a larger amount of data (initially, 5MB per application per browser) can be persistently cached client-side, which provides an alternative to server downloads. A web application can achieve better performance and provide a better user experience if it uses this local storage.

Can localStorage be accessed?

localStorage is quite insecure as it has no form of data protection and can be accessed by any code on your web page.


1 Answers

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.

like image 161
JB Nizet Avatar answered Oct 01 '22 08:10

JB Nizet