Skip to content

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

Closed

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.

Activity

  1. added theissue type on Aug 13, 2025
  2. added this to the 4.0.7 milestone on Aug 31, 2025
  3. added a commit that references this issue on Oct 16, 2025
    5a850fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions