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

Blogs by topic Java Enterprise and user mriem

• Accessibility • Ajax • Blogging • Business • Community 
• Databases • Deployment • Distributed • Eclipse • Education 
• EJB • Extreme Programming • Games • GlassFish • Grid 
• GUI • IDE • Instant Messaging • J2EE • J2ME 
• J2SE • Jakarta • JavaFX • JavaOne • Jini 
• JSP • JSR • JXTA • LDAP • Linux 
• Mobility • NetBeans • Open Source • OpenSolaris • OSGi 
• P2P • Patterns • Performance • Porting • Programming 
• Research • RMI • RSS Feeds • Search • Security 
• Servlets • Struts • Swing • Testing • Tools 
• Virtual Machine • Web Applications • Web Design • Web Development Tools • Web Services and XML 


J2EE

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
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
Whenever the JSF runtime needs to perform a conversion it uses a Converter to do so. As explained in previous blog entries you have the ability to implement your own Converter. But does that mean you need to implement it for simple conversions? No, you do not, the default JSF converters come to the rescue!   <b>Java Datatype</b>        ...
on Dec 26, 2012
The following blog articles are part of the JSF State Saving series Introduction to JSF State Saving The JSF State Saving APIs The JSF StateHolder API The JSF PartialStateHolder API The StateHelper API
on Dec 19, 2012
To facilitate component developers a convenience API was introduced to make it easier to implement the state saving requirements. Access to this API is made available through UIComponent.getStateHelper(). The API defines the following methods:   void add(Serializable key, Object value)   Object eval(Serializable key)   Object eval(Serializable key, Object defaultValue)  ...
on Dec 15, 2012
The definition of a PartialStateHolder according to the PartialStateHolder interface:   void clearInitialState()   boolean initialStateMarked()   void markInitialState()   Note that the methods above do not mention that a PartialStateHolder extends from StateHolder. Be aware that if you want to implement partial state saving you will also need to implement the methods...
on Oct 18, 2012
The definition of a StateHolder according to the StateHolder interface:   boolean isTransient()  void restoreState(FacesContext context, Object state)  Object saveState(FacesContext context)  void setTransient(boolean newTransient) Each of the methods mentioned above have a particular role to fulfill during the JSF lifecycle. Transient or not The setTransient method can...
on Oct 17, 2012
Since state saving happens as part of the JSF lifecycle a component, validator, converter, etcetera that wants to participate in state saving can do so by implementing or using one or all of the below mentioned APIs. StateHolder PartialStateHolder StateHelper StateHolder This is the original API that a component needs to implement if it wants to participate in what is now considered full state...
on Oct 16, 2012
During the JSF lifecycle state will be restored at the beginning of a request (if any state is available) and state will be saved at the end of a request (if any state is available). Why is it important to know what happens during request processing? Well, if you know how JSF state saving works you can optimize your application to perform better. The next blog entry will describe one of...
on Oct 16, 2012
The following blog articles are part of the JSF Converter series Introduction to JSF Converters The JSF Converter API The NumberConverter The DateTimeConverter Writing your own Converter Packaging your JSF Converter
on Oct 11, 2012
In the previous blog entry you learned how to write your own converter. Say you want to distribute this converter to others. How can you make sure the JSF runtime knows about the converter without needing to add it to the faces-config.xml of the web application. As described in the previous blog entry you need to register the converter in a faces-config.xml. To make it a redistributable...
on Oct 5, 2012
Writing you own converter is a pretty straight forward process. It really comes down to implementing the Converter API. Say you want to write a converter that will convert colors. Lets assume we support, "Red", "Green" and "Blue".   package color;  public class ColorConverter implements Converter {    public Object getAsObject(FacesContext context, UIComponent...
on Oct 4, 2012
How would you use the JSF DateTimeConverter? If you are working with dates you probably have had a need to display them in the correct format, or even had to parse them? Well, lets start off with using dateStyle. The example below will use the "long" date style as defined by the server Locale. Valid values are "default", "short", "medium", "long", and "full". &lt;html xmlns:h="http...
on Oct 3, 2012
How do you use the JSF NumberConverter? If you are outputting a value, how would you show a currency code along with it? &lt;html xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">  &lt;h:outputText value="#{user.income}">   &lt;f:convertNumber currencySymbol="USD" type="currency"/...
on Oct 2, 2012
See what the JSF Validator API is about! The definition of a Converter according to the Converter interface:   Object getAsObject(FacesContext context, UIComponent component, String value)  String getAsString(FacesContext context, UIComponent component, Object value) The Faces Context is passed in so the converter can introspect various aspects of the request and response. The UI...
on Sep 21, 2012
Introduction to JSF Converters During the JSF lifecycle each input value needs to be converted. As such the JSF runtime allows you to write converters that will take care of that during request processing. Several standard converters 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 converter...
on Sep 21, 2012
The following blog articles are part of the JSF Validator series Introduction to JSF Validators The JSF Validator API The LengthValidator The LongRangeValidator The DoubleRangeValidator The RegexValidator The RequiredValidator Writing your own Validator Packaging your JSF Validator Multiple component validation The BeanValidator The FacesValidator annotation
on Sep 17, 2012
In the previous blog entry titled "Writing your own validator" you learned how to write a validator and hook it up for validation. At that time we made it all work using the faces-config.xml file. There is however another way, which we will describe below!   package nohelloworld;  @FacesValidator(value="NoHelloWorldValidator")  public class NoHelloWorldValidator...
on Sep 17, 2012
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

Databases

If you are having a problem with your JPA queries and you are trying to understand what SQL queries it actually sends below the covers you can configure the JPA runtime to show the actual SQL statements it sends over. How? Well for EclipseLink you would add the following to your persistence.xml file.   &lt;property name="eclipselink.logging.level" value="FINEST"/>...
on Oct 27, 2013