Why Facelets is preferred over JSP as the view definition language from JSF 2.0 onwards?

True, JSP has some templating capabilities, but the biggest disadvantage of using JSP in JSF is that JSP writes to the response as soon as it encounters template text content, while JSF would like to do some pre/post processing with it. In JSF 1.0/1.1 the following JSF code <h:outputText value=”first”/> second <h:outputText value=”third”/> fourth would … Read more

List of events

You might want to look at “JavaScript HTML DOM Events” for a general overview of events: http://www.w3schools.com/jsref/dom_obj_event.asp PrimeFaces is built on jQuery, so here’s jQuery’s “Events” documentation: http://api.jquery.com/category/events/ http://api.jquery.com/category/events/form-events/ http://api.jquery.com/category/events/keyboard-events/ http://api.jquery.com/category/events/mouse-events/ http://api.jquery.com/category/events/browser-events/ Below, I’ve listed some of the more common events, with comments about where they can be used (taken from jQuery documentation). Mouse Events … Read more

Using PrimeFaces with Bootstrap causes changes in padding/sizing/borders

Almost all other components will fail to, look and feel wise. Since bootstrap 3 switched to a different box-sizing (border-box instead of content-box). So lots and lots of small ui things will fail in PF components, like icons in selectlists being wrongly positioned etc… It is very difficult to fix all these in my opinion. … Read more

Letting the presentation layer (JSF) handle business exceptions from service layer (EJB)

Create a custom service layer specific runtime exception which is annotated with @ApplicationException with rollback=true. @ApplicationException(rollback=true) public abstract class ServiceException extends RuntimeException {} Create some concrete subclasses for general business exceptions, such as constraint violation, required entity, and of course optimistic lock. public class DuplicateEntityException extends ServiceException {} public class EntityNotFoundException extends ServiceException {} public … Read more

What exactly is #{component} in EL?

The #{component} is an implicit EL variable referring the current UIComponent in EL scope (see also implicit EL objects). You can usually only refer it in component’s HTML attribute or in template text children. E.g. in case of <h:inputText> it will reference an instance of UIInput class which has among others an isValid() method. <h:inputText … Read more

Where is Visual Web Editor for JavaServer Faces on Netbeans

That’s the UI editor of the already since ~3 years dead and abandoned Woodstock library . That library became an epic failure due to an bug which revealed when Firefox 3 was released. It turned out that the library generates non-standards compliant Javascript which broke in the newer and more standards-compliant browsers. It was a … Read more