【发布时间】:2013-06-27 04:34:00
【问题描述】:
一个hello.jsp
web.xml 是
<?xml version="1.0" encoding="UTF-8"?>
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 版本="3.0">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- The front controller of this Spring Web application, responsible for
handling all application requests -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map all requests to the DispatcherServlet for handling -->
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
dispatcher-servlet.xml 是
<?xml version="1.0" encoding="UTF-8"?>
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
xmlns:p="http://www.springframework.org/schema/p">
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean name="/hello.html" class="com.spring.HelloWorldController"></bean>
</beans>
JAR 文件是: spring.jar spring-webmvc.jar spring-aop 春豆 弹簧上下文 弹簧上下文支持 弹簧芯 spring-jdbc 弹簧 泉源 弹簧测试 spring-tx
【问题讨论】:
-
你添加了spring-framework库和spring mvc库吗?
-
@TI:很明显异常是因为
org.springframework.web不存在引起的 -
@Rahul 是的,所有库都已添加
-
@SagarVaghela - 部署的 WEB-INF/lib 目录中有哪些 Spring JAR?请在问题中列出它们。
-
@StephenC 我已经展示了所有有问题的弹簧罐
标签: java