Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
agan-tv2 opened this issue Jul 5, 2022 · 0 comments

Comments

@agan-tv2
Copy link

agan-tv2 commented Jul 5, 2022

  • 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 agan-tv2 changed the title defaultValue for annotation @PathParam does not seem to be working [BUG]: defaultValue for annotation @PathParam does not seem to be working Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant