Skip to main content
View by: Most Recent | Topic | Community | Webloggers   
Monthly Archives:    

Blogs by Community: GlassFish

• Adopt a JSR  • Embedded  • GlassFish  
• Global Education and Learning  • Identity Management  • IoT  
• Java Communications  • Java Desktop  • Java Enterprise  
• Java Patterns  • Java Tools  • Java User Groups  
• Java Web Services and XML  • JavaFX  • JCP  
• JDDAC  • Jini  • JXTA  
• Mac Java  • NetBeans  • Open JDK  
• Portlet  • Robotics  • Sun Grid  
• Sun RFID and Sensor  • [no association]  

Java Enterprise

On the #jsf IRC channel Ryan asked how you can get it so the JSF runtime loads resource library contracts from the filesystem. This blog entry will show you how. BE AWARE this code is a proof of concept. To make it production ready make sure you sanitize incoming resource URLs thoroughly! The FilesystemResourceHandler public class FilesystemResourceHandler extends ResourceHandlerWrapper {...
on Nov 15, 2013
In the previous blog entry a single resource library contract was applied. However did you know that you can stack them? We are going to add the following 3 layout contracts, desktop, tablet and phone. The desktop contract <?xml version='1.0' encoding='UTF-8'?><!DOCTYPE html><html xmlns=""   ...
on Nov 14, 2013
In JSF 2.2 you have the ability to define a resource library contract so you can deliver a different experience on the basis of which user visits your website. This blog entry shows you how you can switch between a resource library contract on the basis of an EL expression. To show this off we define 2 CSS styles, blue and red. The blue style body {    background-color: blue;} The...
on Nov 14, 2013
Creating and using a composite component is very straightforward. 1. Creating the composite component 2. Using the composite component Creating the composite component <?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""><...
on Nov 12, 2013
How can you create a custom validator and use it? See below! Creating the custom validator class package customvalidator;import javax.faces.application.FacesMessage;import javax.faces.component.UIComponent;import javax.faces.context.FacesContext;import javax.faces.validator.FacesValidator;import javax.faces.validator.Validator;import javax.faces.validator.ValidatorException;@FacesValidator(value...
on Nov 11, 2013
Jersey 2.4.1 has been released! See the release notes for more information. Or download it from here.
on Nov 9, 2013
Wondering how you programmatically create a flow and use it? 1. Create the Java annotated flow 2. Create the pages package flow;import;import javax.enterprise.inject.Produces;import javax.faces.flow.Flow;import javax.faces.flow.builder.FlowBuilder;import javax.faces.flow.builder.FlowBuilderParameter;import javax.faces.flow.builder.FlowDefinition;public class EnterFlow...
on Nov 8, 2013
When I posted JSF Tip #32 - Override a JSF renderer Twitter user @john_waterwood asked me how you would define a new tag for an existing component and the overridden renderer. Well it is fairly easy, see the 2 steps below! 1. Create your renderer 2. Register it Creating your renderer package org.glassfish.jsf.overrideRenderer;import;import javax.faces.component.UIComponent;...
on Nov 7, 2013
In a previous blog entry I blogged about stateless JSF before, this time I will include the entire page so you can see how silly simple it actually is. And you can also go directly to Subversion to get the sample there. The entirely stateless page <?xml version='1.0' encoding='UTF-8'?><!DOCTYPE html><html xmlns="
on Nov 6, 2013
Say you have a problem with how a particular component renders and you want to do it a bit different. Well in JSF that is not a problem there is a hook-in that you can use to override how a renderer does it rendering. The sample below shows you how to do it. You will have to do 2 things. 1. Register your own renderer for a given renderer type 2. Implement your own renderer. First lets make sure...
on Nov 5, 2013
If you read the blog entry about migrating to @Named annotation you might wonder how you would migrate your @ManagedProperty annotations. Since CDI is a specification on its own, it does not deal with JSF specific artifacts. However with very little work you can have a very similar setup. First we define our own custom annotation @ManagedProperty package test.managedproperty;import java.lang....
on Nov 1, 2013
See the release notes for what was fixed. If you want to download it, see this page for more information. Enjoy!
on Oct 31, 2013
One of the newer features introduced in JAX-RS 2.0 is the support for validating resource classes with Bean Validation Bean Validation support comes in Jersey 2.x by adding jersey-bean-validation module to the class-path. The following sample shows how to use Bean Validation with JAX-RS 2.0. I show how to define a custom constraint which will validate any Enum class. Additionally I will show...
on Oct 30, 2013
Since Mojarra is available as a standalone JAR you can opt to update your Glassfish installation with a newer version. How would you do that? Well it is simple. Make sure your Glassfish container is not running Grab the latest JAR from Replace the javax.faces.jar in the modules directory of your Glassfish directory with the downloaded JAR...
on Oct 29, 2013
Developing RESTful Services with JAX-RS 2.0, WebSockets, and JSON is the new book which Masoud Kalali and I have worked on and recently published. As the technology landscape moves focus towards smaller devices, the need for building scalable, flexible, lightweight, and real-time communications-based applications grows. HTML 5 and Java EE 7 provide a new synthesis of technologies that...
on Oct 18, 2013


JavaEE 7 and Glassfish 4.0 were released a little while ago. What is in the future? Well, see the Aquarium blog for the latest Glassfish Roadmap. And that is it. Enjoy!
on Nov 4, 2013
Tyrus 1.3 has been released, get more information here. Or download it from here. Glassfish users should take all the Tyrus JAR files and replace them in the modules directory with the downloaded ones to get Tyrus 1.3 working in Glassfish. And that is it. Enjoy!
on Nov 2, 2013
#How to run the dev test cases ================================ #Annotation: All of the test cases can't be ran on the windows platform because the firefox can't support the ajax and JSF based on the windows platform very well. If you want to ran the tests, please check out all of the codes to the linux, ubuntu or mac platform. #Steps: 1). Download the firefox and install it, On my platform, I...
on Oct 14, 2013


My JavaOne 2013: Wrapup This blog entry summarizes my session participation at JavaOne 2013. I plan to update this entry with links to the content on as it becomes available. Sessions I Attended In general, speaking more than listening is a very bad way to live. I find this holds true at conferences as well. Here are the sessions I attended. I attended eight and presented six, so I...
on Oct 1, 2013

Open JDK

2013-09-24 Table of Contents 8:30am - Functional Reactive Programming with RxJava 10:00am - The JVM is dead! Long live the Polyglot VM! 1pm - invokedynamic in 45 minutes java.lang.invoke bytecode your turn 3pm - Wholly Graal - Java on GPU graal overview GPU offload 5:30pm - Experimenting with the Boundaries of Static Typing 7:30pm - Developing Small Languages with Scala Parser...
on Sep 24, 2013