I worked a servlet that needs to be converted to a Spring MVC controller in order to have Spring beans access, etc. Why in the normal servlet request.getPathInfo()return not null, but in Spring Controller I get a null value? I know what I can use @PathVariable, but I wonder why the results of this method are the difference?
@RequestMapping(value = {"/test", "/test/*"})
public void test(HttpServletRequest req, HttpServletResponse res) {
log.info(req.getPathInfo() == null);
if (req.getMethod().equalsIgnoreCase("get")) {
} else {
}
}
source
share