What is the purpose of javax.servlet.jsp-api

拥有回忆 提交于 2019-12-03 17:12:17

Marking a dependency as provided will make it available to the compile time and test classpaths but not to the runtime classpath - as you say the container will provide an implementation of these APIs at runtime.

  1. If you are developing a web application it is unlikely you will be able to do without using classes from the Servlet API (HttpServletRequest, HttpServletResponse, Filter etc). While many frameworks abstract away much of the Servlet API it is still likely you will be required to work with these underlying API.

  2. Yes, add scope provided. However you would only need this in the compile time classpath if, for example, you were creating a custom JSP tag by extending say, javax.servlet.jsp.tagext.TagSupport (although tag files provide a more modern way to create custom tags).

  3. Yes and yes.

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