myeclipse 添加 org.springframework.web.servlet.DispatcherServlet 包,
发布网友
发布时间:2022-05-06 19:01
我来回答
共2个回答
热心网友
时间:2023-09-11 14:43
这样添加好么,最好单独去加吧追问还得自己找包吗?他所在包的压缩文件名叫什么啊??
热心网友
时间:2023-09-11 14:43
springmvc-servlet.xml配置:
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <!-- 扫描所有的 controller --> <context:component-scan base-package="com.springmvc.controllers" /> <!-- 启动注解驱动 SpringMVC 功能 --> <mvc:annotation-driven /> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/views/" /> <property name="suffix" value=".jsp" /> </bean></beans>