How to use cookies for GWT Interface changes -
how store gwt user interface settings in persistent cookies, user can them on next visit? have user interface designed using gwt. user prefer see few columns interface every time visit application.so needs done
you can use local storage that.
http://www.gwtproject.org/doc/latest/devguidehtml5storage.html
html5 storage technology caching data on client-side. there 2 types: localstorage (shared browser tabs, stored on disk, 5 mb per webapp) , sessionstorage (accessible within 1 tab, stored in memory). in case, should use localstorage allow user close browser , reload settings disk.
gwt has built-in api using localstorage. see details @ http://www.gwtproject.org/javadoc/latest/com/google/gwt/storage/client/storage.html
also let me propose sample code (you'll need provide details more concrete):
import com.google.gwt.storage.client.storage; ... storage storage = storage.getlocalstorageifsupported(); if (storage != null) { //adding settings storage storage.setitem("some setting key", "some setting"); //removing settings storage storage.removeitem("some setting key remove"); //clearing whole storage contents storage.clear(); }
Comments
Post a Comment