Skip to content

mvc: default value on @QueryParam/@CookieParam/@HeaderParam annotation #3761

@jknack

Description

@jknack
public String query(@QueryParam("25") int max) {
   // max will be 25 by default
}

From lambda/script routes will be:

  var max = ctx.query().getOrDefault("max", "25");

It differs from value(default value) bc the string can be converted to value node and any of the value supported by Value API.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions