How come request.getPathInfo() in service method returns null?

前端 未结 2 633
终归单人心
终归单人心 2020-12-17 09:57

I wrote Front Controller Pattern and ran the test. Somehow request.getPathInfo() is returning null when it should return the path info.

1. HTML that calls se

2条回答
  •  半阙折子戏
    2020-12-17 10:40

    According to the Javadoc:

    Returns any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path but precedes the query string. This method returns null if there was no extra path information.

    You don't have any path info when using a prefixed mapping (*.do, in your case).

提交回复
热议问题