我在spring mvc中练习一个例子,我创建了动态web项目,使用tomcat8.5当我试图点击url时,它在浏览器上显示代码。我在网上搜索了一下,没有找到任何解决办法。
Name : | |
Salary : | |
Designation : | |
web.xml:
SpringHelloWorld
spring
org.springframework.web.servlet.DispatcherServlet
1
spring
/*
org.springframework.web.context.ContextLoaderListener
contextConfigLocation
/WEB-INF/spring-servlet.xml
jsp
text/plain
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
spring-config.xml文件:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd ">