【发布时间】:2018-04-12 01:20:54
【问题描述】:
全部 我正在开发一个简单的登录项目,并试图让应用程序在 tomcat 服务器中运行,我也遇到了“无法更改项目方面动态 Web 模块版本错误”的几个问题。”试图通过更改模块的版本并确保也存在适当的java jee。但失败了。现在有这个服务器上下文初始化失败错误。还有。有人可以帮我吗。 提前致谢
SampleLoginApp-servlet.xml:
enter code here
<?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/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
<context:component-scan base-package="com.sample.Controller"></context:component-scan>
<mvc:annotation-driven></mvc:annotation-driven>
<bean id="jspviewresolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsps/"></property>
<property name="suffix" value=".html"></property>
</bean>
</beans>
web.xml
在此处输入代码
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>SampleLoginApp</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description></description>
<display-name>SampleLoginApp</display-name>
<servlet-name>SampleLoginApp</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>SampleLoginApp</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
【问题讨论】:
标签: java spring maven tomcat jakarta-ee