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

Blog Posts by Community

• 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

Since JSF 2 it is also possible to use BeanValidation as specified in JSR 303. The following blog article describes how this JSR has been integrated within JSF 2. With the following JSF managed bean. public class UserInfo {    /**     * Stores the username.     */    private String username;    /** ...
on Sep 17, 2012
Writing your own validator is a straightforward process. It involves implementing the Validator API and making sure you register it properly. Say you want to write a validator that will not allow you to use the string "Hello World" as a value.   package nohelloworld;  public class NoHelloWorldValidator implements Validator {        public void...
on Sep 9, 2012
Say you want to make sure that a value is required. <html xmlns:h="http://java.sun.com/jsf/html"  xmlns:f="http://java.sun.com/jsf/core">  <h:inputText value="#{user.firstName}">   <f:validateRequired/>  </h:inputText> </html> If you want to disable the RequiredValidator on a page you can...
on Sep 7, 2012
If you want to validate input against a regular expression then you would use the RegexValidator. Say you want to make sure only letters are used for a name. <html xmlns:h="http://java.sun.com/jsf/html"  xmlns:f="http://java.sun.com/jsf/core">  <h:inputText value="#{user.firstName}">   <f:validateRegex pattern=...
on Sep 6, 2012
Just like the LongRangeValidator before the DoubleRangeValidator validates if the given value is within the given range, but then a range of doubles. Say you want to make sure your donors can donate as little as 1.00 but at most 250.00. <html xmlns:h="http://java.sun.com/jsf/html"  xmlns:f="http://java.sun.com/jsf/core">  <h:inputText value=...
on Sep 5, 2012
If you want to make sure a value is within given Long range then the LongRangeValidator is for you! Say you want to make sure your users are at least 13 but at most 18. <html xmlns:h="http://java.sun.com/jsf/html"  xmlns:f="http://java.sun.com/jsf/core">  <h:inputText value="#{user.age}">   <f:validateLongRange...
on Sep 5, 2012
The LengthValidator is one of the standard validators that is specified by the JavaServerFaces specification. It allows you to verify (validate) if the proposed input (submitted value) on a given component is valid. Say you want to make sure the minimum length of a password is 6 characters and up to 12 characters. The example below describe how you would put this into a JSF page to make that...
on Sep 4, 2012
The definition of a Validator according to the Validator interface: void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException The Faces Context is passed in so the validator can introspect various aspects of the request and response. The UI component is passed in because the actual value will be stored in that UI component after it has been...
on Sep 3, 2012
During the JSF lifecycle each input value can be validated. As such the JSF runtime allows you to write validators that will take care of that during request processing. Several standard validators are part of the standard JSF runtime. Note that the specification has been written with extension in mind so it is also possible to write your own validator and hook it up for request processing...
on Sep 1, 2012

Java Tools

Acceptance Test Driven Development (ATDD) is a very effective development practice that essentially involves writing specifications in the form of documented and automated examples. These automated examples become automated acceptance tests that validate the features being delivered. The process of writing these examples encourages teams to focus on where the business value of a feature is coming...
on Sep 12, 2012
While I don't normally blog about the exiting world of JVM command line options, this new 7.0 option, which allows you to rotate to a new GC log file, was just so exciting... err... not so widely published that I decided to share. Of course these options only apply when you've used the -Xloggc: option. The settings are; UseGCLogFileRotation, default value: false NumberOfGCLogsFiles, default value...
on Aug 20, 2012

Java Desktop

by Dan McCreary and Ann Kelly, Authors of Making Sense of NoSQL Bigtable systems are important NoSQL data architecture patterns because they can quickly scale to manage large data volumes. They are also known to be closely tied with many MapReduce systems. In this article from Making Sense of NoSQL, the authors discuss how Bigtable systems store data using row and column keys and how they...
on Sep 10, 2012
Swing is not dead, still. While a whole lot of evangelists try to talk it dead, it is still part of the JRE. While SWT is not, still. And while JavaFX is not, still. Dispite all hypes and rumors. It is not even declared to be deprecated or obsolete. So in fact, there is no other real alternative to Swing as long as the GUI must work solely with JRE means (I won't say AWT is an alternative). And...
on Sep 7, 2012
The Application Architectures document is now available. It describes the three architectural models (see figure below) available to programs, and includes sample code for a simple directory-watcher in all three models. The sample code in Application Architectures also illustrates some non-trivial capabilities: creating a new thread (java.lang.Thread object) from JavaScript, and using a...
on Aug 25, 2012

Java User Groups

The Bucharest Java User Group is up and running in Bucharest, Romania! The JUG held its fourth meeting (see picture) on August 23. The group's first meeting was held on May 24. In a message to the Java.net JUG Leaders email list, Bucharest JUG leader Ioan Eugen Stan noted: "We've started a JUG in Bucharest and we're doing well. We've just held our 4'th edition and there is a huge interest."...
on Sep 8, 2012

Java Patterns

I hate adding lots of huge multi-JAR all-purpose common libraries to rather small projects! Huge footprint just for a single class is a side effect of many popular frameworks, unfortunately, due to rather coarse-grained modularity. So I started to publish some of my commons (LPGL'ed) code as single-class self-contained artifacts on The Maven Central Repository. You simple need a Range<T>...
on Sep 7, 2012

Java Communications

Creating a Reusable Service (by Jos Dirksen, Author of "SOA Governance") August 29, 2012 Manning Publications Co. Having a standard-based search engine as an access point to your service is a good way to improve the reusability of your service. In this article based on chapter 4 of SOA Governance in Action, author Jos Dirksen presents you with a couple of guidelines that can help you in...
on Sep 5, 2012

JCP

JSR 359 has been accepted by Java SE/EE executive committee a month back. Please see the specification request for the content of this revision of SIP Servlet 2.0 specification. We have established a java.net project for cordinating and communicating the progress of the specification. The work is about to get started. At the moment, the expert group is being formed and some of the leading...
on Sep 3, 2012

Open JDK

In the most recently completed Java.net poll, a majority of the voters indicated a preference for having major Java releases on a predictable schedule (either a fixed number of months, or a narrow range of months). A total of 683 votes were cast in the poll, and one comment was posted. The exact question and results were as follows: Should Java have a timed release schedule (for example, a new...
on Aug 29, 2012

Embedded

Embedded Java is receiving significant new attention, with the first Java Embedded @ JavaOne conference taking place October 3-4, supported in part by members of Java.net's new Java Embedded Community. The Java Embedded @ JavaOne content catalog currently lists 23 sessions, ranging from keynote addresses by Hasan Rizvi ("Java Embedded: Product Strategy") and Judson Althoff ("Java Embedded:...
on Aug 17, 2012