Guava Cache basic demo

Here I go with the caching! Caching (and cache invalidation) is second one of the most difficult thing to do while programming (the first one is the naming things problem :P ). I'll show the demo with Guava Cache (18.0). Source Code for this tutorial is on my GitHub: https://github.com/yacekmm/looksok/tree/GuavaCacheDemo/Guava/GuavaCacheDemo Caches Explained You may want … Continue reading Guava Cache basic demo

“5 reasons to use Guava”

Easier use of java collections, functional programming, method arguments validations, caches, rate limiters and more - this is why Google's Guava library may be useful for you. Read concise description of five sample features in Guava that you may find helpful: http://www.javacodegeeks.com/2013/06/5-reasons-to-use-guava.html

HTML 5 Offline Web Application with Spring Boot

Think of users using your web application from mobile phones when their internet connection breaks down. Native mobile app would still work and cache all user actions, synchronizing them afterwards. HTML5 web apps can also work offline. Basically it is done by listing the resource files (html, js, images) that browser should cache immadietly and use the … Continue reading HTML 5 Offline Web Application with Spring Boot

Refresh JSF page programmatically from JavaBean

When business logic in JavaBean decides that forced jsf page refresh is needed, it can be done from logic's level. Add this code to your logic (prefereably put it in some refresh() method): FacesContext context = FacesContext.getCurrentInstance(); String viewId = context.getViewRoot().getViewId(); ViewHandler handler = context.getApplication().getViewHandler(); UIViewRoot root = handler.createView(context, viewId); root.setViewId(viewId); context.setViewRoot(root); Browsers may have … Continue reading Refresh JSF page programmatically from JavaBean