blade icon indicating copy to clipboard operation
blade copied to clipboard

[BUG]: defaultValue for annotation @PathParam does not seem to be working

Open agan-tv2 opened this issue 2 years ago • 0 comments

  • System Version (e.g. Mac Os 10.14.3): MacOS 12.4 Build 21F79
  • Build tools (e.g. maven/gradle): Gradle
  • JDK Version (e.g. 1.8): 11.0.14
  • Blade Version (e.g. 2.1.2.RELEASE): 2.1.2.RELEASE

Describe the bug

defaultValue for annotation @PathParam does not seem to be working.

Current behavior:

Path with parameter that has a default value returns 404 not found.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new basic Blade application with a controller class.
  2. Add the following code to controller:

@GET(value = "/test/:param") public void test(@PathParam(defaultValue = "myDefaultParam") String param) { System.out.println(param); }

Note: defaultValue can be set to anything you like. Even setting it to "" (blank) is not working.

  1. Run application and navigate to http://127.0.0.1:9000/test/
  2. Notice that you get error 404 not found and nothing is being printed in console, instead of getting defaulted to http://127.0.0.1:9000/test/myDefaultParam. If you try to access http://127.0.0.1:9000/test/whatever you will get to the specified page and whatever, in this case, will be printed to console.

Expected behavior:

One should get directed to the path with the specified defaultValue when nothing else is specified.

agan-tv2 avatar Jul 05 '22 19:07 agan-tv2