Default Value in QueryParam Annotations

| No Comments
In order to remove any null pointer exceptions while using RestEasy Annotations, you can always pass a default value and handle it appropriately in the Data Access Objects ( If you are using one. This ensures that there are no null pointer excpetions from the returning classes.

Here is a code snippet to do just this:

public StreamingOutput getUsersSummaryList(@QueryParam("active") @DefaultValue("0") String active  ){}

Leave a comment

Pages

About this Entry

This page contains a single entry by Armaghan published on August 7, 2009 10:37 AM.

PermGen space error (Hibernate, JPA) was the previous entry in this blog.

Dump the Ant build information to a log file is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Categories