sessionStorage/localStorage scope

Firstly, localStorage and sessionStorage are 2 objects on the window object. They tie to the origin of the current window. As a result they are bind to : protocol, http/https are different domain subdomain can share with parent by manually setting document.domain. xxx.capitalone.com cannot share with yyy.capitalone.com port Same thing apply to 302 redirect. The session/local storage value…

Persist and pass FacesMessages over multiple page redirects

Very Simple In a JSF Reference Implementation, passing global faces messages between pages doesn’t work. It’s not designed that way “out of the box.” Fortunately there is a way to do this, which will even support redirects between pages, forwards through a RequestDispatcher, and also through standard JSF navigation cases. There is a 5 minute…

p:commandButton needs two clicks to fire action primefaces

I need to click my button twice to fire an action. There seems to be a depency on the navigation of the site that’s calling this page. If the previous navigation is done by a <p:button outcome=”next_page”> the button on “next_page” reacts on the first click. Using <p:commandButton action=”next_page”> i need two clicks on “next_pages”‘s…

Mobile site redirect

Direct JS way: if( isTouchScreen ) window.location.replace(“http://fairfax.va.golookon.com/mobile&#8221;);   这个方法会先load full site  页面,不太好~而且即使用户点了full site链接也会被redirect到mobile site。   Use  redirection_mobile.min.js Get the JS file here. code: <script type=”text/javascript” src=”/redirection_mobile.min.js”></script> <script> SA.redirection_mobile ({ tablet_redirection : “true”,  //tablet也redirect mobile_url : “fairfax.va.golookon.com/mobile” }); </script> 这样通过cookie的方式,用户只有第一次会被导入mobile site。