We can convert a String to a primitive long using the Long.parseLong method or to a wrapped Long class using the Long.valueOf. When both methods receive an invalid number as argument, a java.lang.NumberFormatException will...
We can convert a String to a primitive int using the Integer.parseInt method or to a wrapped Integer class using the Integer.valueOf. When both methods receive an invalid number as argument, a java.lang.NumberFormatException will...
In this tutorial we show you how to split a string in Java. We explore the usage of String#split(regex) method and the StringTokenizer class. The first one is recommended to use in future projects....
In this tutorial we will show you how to parse a date in Java. To parse a date the JDK provides a SimpleDateFormat class. You can either define your own custom date format strings...
In this tutorial we will show you how to format date in Java. To format a date the JDK provides a SimpleDateFormat class. You can either define your own custom date format strings or...
This tutorial shows you how to create a JSF Dropdown menu. We can provide values to the <h:selectOneMenu> or jsf dropdown menu in three ways: hard-coded, via a map or via an object array....
In this tutorial we will show you how to remove the id and/or autocomplete attribute from the viewstate. Although it is not a good idea to remove the autocomplete function in firefox. We can...
This tutorial explains how to use the <h:commandButton> element. The <h:commandButton> generates by default a HTML <input type=”submit”> element which submits the parent form using an HTTP POST method. This form is required. If...
In this tutorial we will show you how to use checkboxes in JSF. We can have two types of checkboxes: SelectBooleanCheckbox: assign a single value to the managed property. selectManyCheckbox: assigns an array of...
In this tutorial we will show you the new JSF 2 HTML5 placeholder and passThroughAttribute. JSF 2.2 introduces pass through attributes to support new and modified attributes defined in HTML5. Components don’t process pass...
Follow:
Subscribe to our monthly newsletter to receive the latest news right in your inbox.