Home » Tag Archives: JSF (page 6)

Tag Archives: JSF

JSF Event-based communication: New-school approach

jsf-logo

In the last post, we learnt event-based communication on basis of Observer / Event Listener and Mediator patterns. Due to their shortcomings I would like to show more efficient ways for event-based communication. We will start with Google Guava EventBus and end up with CDI (Contexts and Dependency Injection for the Java EE platform). Guava EventBus Google Guava library has ...

Read More »

JSF Simple Ajax Samples

jsf-logo

Today we will see some Simple Samples of Ajax with JSF. If you want to see other posts about JSF/Web Applications click on the next links: JSF Persisting Objects and Messages after a Redirect ,User Login Validation with JAAS and JSF, JSF: Converter and Bean AutoComplete, JSF – Hello World, Auto Complete, Handling Exceptions on a WebApp, User Authentication (Filter/Servlet), ...

Read More »

JSF Event-based communication: Old-school approach

jsf-logo

Web applications written in JSF consist of beans which interact among each other. Communication between beans is one of the main design patterns when developing a web application. Sometimes, one bean need to send events to other beans to inform them about some changes or whatever else. We can normally inject a managed or Spring bean into the property of ...

Read More »

Four solutions to the LazyInitializationException – Part 2

jsf-logo

This article continues from part 1 of the tutorial. Load collection by Stateful EJB with PersistenceContextType.EXTENDED This approach can be applied only to applications that works with Full JEE environments: to use a EJB with PersistenceContextType.EXTENDED. Check the code below how the DAO would look like: package com.ejb; import javax.ejb.Stateful; import javax.persistence.*; import com.model.Person; @Stateful public class SystemDAOStateful { @PersistenceContext(unitName ...

Read More »

Four solutions to the LazyInitializationException – Part 1

jsf-logo

In the post today we will talk about the common LazyInitializationException error. We will see four ways to avoid this error, the advantage and disadvantage of each approach and in the end of this post, we will talk about how the EclipseLink handles this exception. To see the LazyInitializationException error and to handle it, we will use an application JSF ...

Read More »

Full Web Application Tomcat JSF Primefaces JPA Hibernate – Part 3

primefaces-logo

Primefaces AutoComplete, JSF Converter This post continues from part 1 and part 2. The JSF has the Converter tool that helps us get some data from the user view and transform into an object loaded from the database or a cache.           In the “com.converter” package create the following class: package com.converter; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; ...

Read More »

Full Web Application Tomcat JSF Primefaces JPA Hibernate – Part 2

primefaces-logo

ManagedBeans This post continues from part 1 of this tutorial. In the “com.mb” package you will need to create the classes bellow:             package com.mb; import org.primefaces.context.RequestContext; import com.util.JSFMessageUtil; public class AbstractMB { private static final String KEEP_DIALOG_OPENED = 'KEEP_DIALOG_OPENED'; public AbstractMB() { super(); } protected void displayErrorMessageToUser(String message) { JSFMessageUtil messageUtil = new JSFMessageUtil(); messageUtil.sendErrorMessageToUser(message); ...

Read More »

Spring & JSF integration: Exception Handling

jsf-logo

Most JSF developers will be familiar the “An Error Occurred” page that gets displayed when an unexpected exception is thrown somewhere their code. This page is really useful when developing but is not something you usually want for a production application. You generally have a couple of options when it comes to replacing this page with stock JSF; you can ...

Read More »

Full WebApplication JSF EJB JPA JAAS – Part 2

jsf-logo

View – Creation and JSF set up This tutorial continues from part 1. Let us create a new Dynamic Web Project. Create it like the image bellow: Pay attention: in some moment the Eclipse will ask you if you want to add the JSF Capabilities (auto complete), enable it. Like the screens bellow: After the project creation, let us edit ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.