Skip to content

Instantly share code, notes, and snippets.

@stoicflame
Created March 21, 2012 20:58
Show Gist options
  • Save stoicflame/2152787 to your computer and use it in GitHub Desktop.
Save stoicflame/2152787 to your computer and use it in GitHub Desktop.
JAX-RS example with @DefaultValue
@Path("/path/to/my/changes")
public class ChangeHistoryResource {
public static final String START_DEFAULT = "0";
public static final String COUNT_DEFAULT = "100";
...
public ChangeListOrWhateverItsCalled getChangeList(@QueryParam("start") @DefaultValue(START_DEFAULT) String start,
@QueryParam("count") @DefaultValue(COUNT_DEFAULT) Integer count) {
//implementation
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment