blade
blade copied to clipboard
[BUG]: defaultValue for annotation @PathParam does not seem to be working
- 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:
- Create a new basic Blade application with a controller class.
- 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.
- Run application and navigate to
http://127.0.0.1:9000/test/
- 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 accesshttp://127.0.0.1:9000/test/whatever
you will get to the specified page andwhatever
, 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.