I have such line in my routes
file:
GET /api/blahblahblah/{aaa}/{bbb}/{ccc} Application.process
And I have a controller Application
with method process
:
public static void process(String aaaParam, String aaaParam, String ccc) { ... }
So I access the controller this way: http://localhost:9000/api/blahblahblah/one/two/three
The problem is that inside this method only ccc
parameter has it's value ("three" in this case), aaa
and bbb
always are null
.
Well, my bad. I've figured out the reason of NPE by myself. The thing is that method params names should exactly match the routes params names: parameters don't correspond by order (as I thought), but by name .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.