SpringMVC的pom.xml、xxx-servelt.xml、web.xml

news/2024/10/19 16:41:27/

pom.xml 

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><modelVersion>4.0.0</modelVersion><packaging>war</packaging><name>untitled1</name><groupId>com.rbynode</groupId><artifactId>untitled1</artifactId><version>1.0-SNAPSHOT</version><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-war-plugin</artifactId><version>3.3.2</version><configuration><failOnMissingWebXml>false</failOnMissingWebXml></configuration></plugin><plugin><groupId>org.mortbay.jetty</groupId><artifactId>maven-jetty-plugin</artifactId><version>6.1.7</version><configuration><connectors><connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"><port>8888</port><maxIdleTime>30000</maxIdleTime></connector></connectors><webAppSourceDirectory>${project.build.directory}/${pom.artifactId}-${pom.version}</webAppSourceDirectory><contextPath>/</contextPath></configuration></plugin></plugins></build><dependencies><!-- SpringMVC --><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>5.3.23</version></dependency><!-- 日志 --><dependency><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId><version>1.2.3</version></dependency><!-- ServletAPI --><dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.1.0</version><scope>provided</scope></dependency><!-- Spring5和Thymeleaf整合包 --><dependency><groupId>org.thymeleaf</groupId><artifactId>thymeleaf-spring5</artifactId><version>3.0.12.RELEASE</version></dependency></dependencies></project>

web.xml

<?xml version="1.0" encoding="UTF-8"?><web-app version="2.4"xmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"><!-- 配置SpringMVC的前端控制器,对浏览器发送的请求统一进行处理 --><servlet><servlet-name>springMVC</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><init-param><param-name>contextConfigLocation</param-name><param-value>classpath:springMVC-servlet.xml</param-value></init-param><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>springMVC</servlet-name><!--设置springMVC的核心控制器所能处理的请求的请求路径/所匹配的请求可以是/login或.html或.js或.css方式的请求路径但是/不能匹配.jsp请求路径的请求--><url-pattern>/</url-pattern></servlet-mapping></web-app>

xxx-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"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd"><context:component-scan base-package="com.rbynode.controller"></context:component-scan><!-- 配置Thymeleaf视图解析器 --><bean id="viewResolver" class="org.thymeleaf.spring5.view.ThymeleafViewResolver"><property name="order" value="1"/><property name="characterEncoding" value="UTF-8"/><property name="templateEngine"><bean class="org.thymeleaf.spring5.SpringTemplateEngine"><property name="templateResolver"><bean class="org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver"><!-- 视图前缀 --><property name="prefix" value="/WEB-INF/templates/"/><!-- 视图后缀 --><property name="suffix" value=".html"/><property name="templateMode" value="HTML5"/><property name="characterEncoding" value="UTF-8" /></bean></property></bean></property></bean>
</beans>


http://www.ppmy.cn/news/884364.html

相关文章

ASO优化之在海外如何进行竞品分析

进行竞争对手研究&#xff0c;需要分析当前的市场形势&#xff0c;确定竞争对手表现的模式&#xff0c;并将其应用到我们应用营销策略中。不同的应用可以在直观的用户界面上进行简单的比较&#xff0c;很容易看到长期趋势。 在App Store和Google Play上获取竞争对手评论区的信…

(转自)何新:谈“玄”(一)

如果我们承认真理是不可知的&#xff0c;那我们也就无法理解&#xff1a;为什么我们还要浪费精神而来研究哲学&#xff1f; ——黑格尔① ①有时我故意不提供引文出处&#xff0c;考考那些通人和“专家”吧。幽他一默。 &#xff3b;本文原只是答一位朋友的信。但改来改去…

mina下载

mina下载地址&#xff1a;https://mina.apache.org/downloads-mina.html 目前mina最新版本是2.0.13 解压后的mina文件夹如下&#xff1a; 文件夹具体作用如下&#xff1a; dist文件夹&#xff1a;mina库代码运行的jar包 docs文件夹&#xff1a;api文档 lib文件夹&#xff1a;使…

国王杯:瓦伦西亚3:0晋级八强 米纳梅开二度

资料图&#xff1a;瓦伦西亚球员在比赛中。 中新社发 韩海丹 摄 中新网1月16日电 2018-19赛季西班牙国王杯1/8决赛次回合展开争夺&#xff0c;瓦伦西亚主场3&#xff1a;0完胜希洪竞技&#xff0c;以总分4&#xff1a;2翻盘晋级八强。 首回合比赛&#xff0c;瓦伦西亚1&#…

Google全球三大数据中心自然冷却方案剖析

Google将其数据中心技术作为一个核心竞争力,很少对外公布其技术细节,因此搜索巨人的数据中心一直是个谜.根据谷歌公布其数据中心能耗发展的图表,在图表中显示近年来谷歌在能耗控制方面有了明显的进步。    本文针对Google数据中心的特点,介绍Google位于欧洲的三个不同实现自…

python大乐透号码生成器_国庆长假写了个体彩大乐透彩票号码生成器小程序

国庆假期,除了带娃,就是回复客人和工厂邮件,还有看书了。 带娃大家都懂得,惨绝人寰,(好吧,女儿还是挺可爱的,但是精力太充沛了,自愧不如啊)比起来工作和看书就是天堂了。。。 不过假期有点长,后面几天思想又开始蠢蠢欲动了。 平时也会买个4块钱的体育大乐透彩票娱乐下…

阅读《Unsupervised Evaluation of Interactive Dialog with DialoGPT》

Unsupervised Evaluation of Interactive Dialog with DialoGPT 目录 Abstract 1 Introduction 2 Related Work 2.1 Automatic Dialog Evaluation 2.2 Dialog Qualities 2.3 Pre-trained Dialog Models 3 Data Collection 3.1 Turn-Level Annotation 3.2 Dialog-Level Annotati…

第4版 网页设计与制作 HTML5+CSS3+JavaScript(赵丰年 编著)学习笔记

第1章 HTML5基础 1.万维网&#xff08;World Wide Web,WWW)由大量的Web服务器构成。我们通过浏览器访问这些服务器上的网页。不同的网页通过超链接联系在一起&#xff0c;构成了WWW的网状结构。 2.HTML是表示网页的一种规范&#xff0c;它通过标记符定义了网页内容的显示&a…