I have to get params from URL using @PathValiable in SpringBoot application. These params often have slashes. I don't have a control about what a user would enter in URL so I would like to get what he has entered and then I can handle with it.
I have already looked through materials and answers here, I don't think that for me the good solution is to ask users somehow encode the entering params.
The SpringBoot code is simple:
@RequestMapping("/modules/{moduleName}")
@ResponseBody
public String moduleStrings (@PathVariable("moduleName") String moduleName) throws Exception {
...
}
So the URL for example would be the following:
http://localhost:3000/modules/...
The issue is that the param moduleName often has slashes.
For example,
metadata-apicb-metadata-services OR
app-customization-service-impl\modules\expand-link-schemes\common\app-customization-service-api
So a user definetely can enter:
http://localhost:3000/modules/metadata-apicb-metadata-services
Is this possible to get everything what a user has entered in URL after /modules/?
If anyone tell me what are the good ways to handle such issue.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…