找不到的原因是:
eclipse沒有安裝spring插件,安裝插件就OK了,
插件下載地址:
此處的插件下載要注意插件版本
插件下載:
https://spring.io/tools3/sts/all
csdn下載:
https://download.csdn.net/download/fylqq/11862374
具體參看:
https://blog.csdn.net/DCL_CSDN/article/details/89841685
安裝時,可能會遇到
An error occurred while collecting items to be installed session context was:(profile=D__DevelopTools_eclipse_jee-oxygen_eclipse, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,oracle.eclipse.tools.rest.lib,17.0.0.201709131633
報錯
解決方案:https://blog.csdn.net/zf_csdn/article/details/79379955
再就是安裝的時候一定要注意離線安裝,不然可能會一直出問題
安裝好了以後,如果找不到Spring Bean Configuration File選項
https://blog.csdn.net/sqzhao/article/details/88393045
如果生成不了disDispatcherServlet就直接複製下面的代碼
<servlet>
<servlet-name>springDispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>location</param-value><!--加載配置文件,常用寫法classpath:配置文件名 記得帶上配置文件名的後綴哦-->
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map all requests to the DispatcherServlet for handling -->
<servlet-mapping>
<servlet-name>springDispatcherServlet</servlet-name>
<url-pattern>/</url-pattern><!--過濾所有請求 個人建議直接用/-->
</servlet-mapping>
複製完了以後,我們再解決這個問題:
https://blog.csdn.net/meiqi0538/article/details/81218522
spring框架下載鏈接:
https://repo.spring.io/release/org/springframework/spring/
這些工作都搞定以後XML中的spring代碼生成提示就可以搞定了