How specify path to .JSP file for request.getRequestDispatcher()?

独自空忆成欢 提交于 2019-12-01 23:51:27
BalusC

The RequestDispatcher operates already relative to the current web application context. You don't need to prepend the context path.

Why it is required for JS/CSS/image/etc resources which are linked in HTML is simply because it's the webbrowser who has got to download them by a proper URL path. A common starters mistake is that they think that it's the webserver who has got to auto-include them by a local disk file system path somehow. This is thus not true. It has really to be an URL, like the one as you enter in browser's address bar.

See also:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!