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

Blogs by topic Blogs 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

If you have wanted JSF not to store any state now is your chance to try out the stateless mode of JSF. It is as easy as doing the following: <f:view transient="true">  Your regular content</f:view> And voila you are running stateless. If you decide you do want some state to be kept at the server you can use the @xxxScoped annotations on your beans Be aware that...
on Feb 8, 2013
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 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
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
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
 In the previous article we described how to do testing with multiple containers. But since joining the Glassfish team I have wondered how can I test applications against different versions of JSF on Glassfish? As it turns out it is actually quite straightforward. This blog entry shows you how to do it. It will allow you to test using a 2.1.2 version and up. All by using properties passed in...
on Jan 5, 2012
In the previous article we have worked out how to run the integration tests against Glassfish, but what about other versions of Glassfish or even other servers? Well, the infrastructure groundwork has been laid for that. Before we are going to reap the fruits we are going to explain the difference between downloading, installing and configuring your server within Cargo. The main reason...
on Dec 22, 2011
In the previous article we added the Glassfish application server into the mix for testing. This looks all nice,but one might wonder how this would work in a parent project (POM) and child projects setup. Well it is fairly easy to accomplish. We will move all the bits first over to the new parent POM we are going to use. See below for what theparent POM will look like. <?xml version=&...
on Dec 20, 2011
In the previous article we described a setup for integration testing. It did not explain how to do automatic deployment to an application server. Since we want to make it convenient to do integration tests we are now going to add Glassfish into the mix. Note that in the previous article we put the integration testing into a separate profile. We are now going to put it back into the normal build...
on Dec 15, 2011
If you want to do integration testing using HtmlUnit and Maven the following sets you up for easy testing. 1. Create a Maven web application project 2. Add index.jsp page (or whatever flavor of framework you want to use). 3. Add HtmlUnit dependency 4. Write integration test for the index.jsp page 5. Add the profile to support running of the integration tests separate from the main build cycle...
on Dec 13, 2011
The JSF 2.2 ballot was approved, so now it is time to start speaking up about what you think needs to be in JSF 2.2. Obviously it takes a bit of time to start organizing the Expert Group. But nowadays individuals can join too. So there really is no excuse to start contributing. If you do not know how to get started feel free to comment!
on Apr 1, 2011
The JavaEE 7 umbrella JSR has been approved. A step in the right direction. Now we'll just have to see what is going to be included for real :)
on Mar 29, 2011

Testing

 In the previous articles we have concentrated on testing using Glassfish. But can you use the same recipe to do testing on Weblogic. The answer is YES, but ..... Yea you know there is always a caveat. First make sure you have Weblogic installed properly. Note I did the testing with the latest 12c version, so your mileage may vary. Download the attached zip file again and follow along. In...
on Jan 13, 2012

NetBeans

 I'll be reviewing NetBeans IDE 7 Cookbook, stay tuned!
on Aug 1, 2011