Feeds:
Posts
Comments

Archive for May, 2008

Refresh current JSF page

If for some reason you need to fully refresh current JSF page, in your action you can use code like:

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);

Or if your page doesn’t get refreshed due to browser caching, you can set appropriate headers to response in PhaseListener, RENDER_RESPONSE phase:

response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pragma", [...]

Read Full Post »

I always hate to upgrade, I know everything works for me the way it is, so why make my life more complicated? After such thoughts I just forget it for a few days. (Well, actually almost always I use beta versions of Ubuntu without any problems, just this time it’s not the case) .
Ok, so [...]

Read Full Post »