首页 > 其他分享 >框架的常用配置(一直更新)

框架的常用配置(一直更新)

时间:2022-10-31 14:04:00浏览次数:50  
标签:常用 http 框架 www springframework 更新 org DispatcherServlet schema


 

框架配置:

web.xml配置:

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
<display-name>Archetype Created Web Application</display-name>
<!--
配置前端控制器DispatcherServlet
-->

<servlet>
<servlet-name>DispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!--设置初始化参数,指定springmvc.xml的配置文件,tomcat启动的时候加载该配置-->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<!--
完全匹配: /DispatcherServlet
目录匹配: /aaa/bbb/DispatcherServlet
扩展名匹配: *.do *.action

浏览器访问的路径:
localhost:8080/day26/itemList.action
-->
<url-pattern>*.action</url-pattern>
</servlet-mapping>

</web-app>

springMVC配置:

<?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.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">

<!--
包扫描: 该配置文件只扫描controller层
-->
<context:component-scan base-package="com.itheima.controller"/>
<!--1.配置处理器映射器-->
<!--<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>-->
<!--2.处理器适配器-->
<!-- <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"/>-->

<!--配置注解驱动,代替处理器映射器和处理器适配器-->

<mvc:annotation-driven/>
<!--3.视图解析器
@see #setPrefix
@see #setSuffix
-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>

log4j.properties:日志配置

# Global logging configuration
#日志级别: DEBUG 调试级别(信息最全) INFO 一般信息 ERROR 错误级别
log4j.rootLogger=DEBUG, stdout
# Console output...

#以下配置输出到控制台
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
#输出的格式
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n

 

标签:常用,http,框架,www,springframework,更新,org,DispatcherServlet,schema
From: https://blog.51cto.com/u_12277263/5809516

相关文章

  • linux常用命令(一【公开版】)
    目录​​常用的:​​​​help:(2种)​​​​文件和目录常用命令​​​​LS:​​​​cd:​​​​touch:​​​​rm: ​​​​拷贝和移动文件:​​​​查看文件内容:​​​​c......
  • ssm框架的环境搭建(公开版)
    目录​​1.新建项目​​​​建立步骤​​​​创建包结构:​​​​2.jar的准备​​​​pom.xml​​​​3.准备静态资源​​​​itemEdit.jsp:​​​​itemList.jsp:​​​​web.......
  • VM系列振弦采集模块如何更新固件获取更多功能
    VM系列振弦采集模块如何更新固件获取更多功能固件升级更新固件存在一定风险,可能导致设备无法使用,请慎重操作。BL4VM是预置于VM系列振弦模块内的一段程序,可以完成基于......
  • VM系列振弦采集模块如何更新固件获取更多功能
    VM系列振弦采集模块如何更新固件获取更多功能固件升级更新固件存在一定风险,可能导致设备无法使用,请慎重操作。BL4VM是预置于VM系列振弦模块内的一段程序,可以完成基于......
  • 设置Google浏览器不更新
    设置Google浏览器不更新右键计算机=>管理,在计算机管理(本地)=>系统工具=>任务计划程序=>任务计划程序库中找到两个和Google自动更新相关的任务计划:GoogleUpdateTaskMa......
  • 常用Cron表达式整理
    每天凌晨2点002**?和每天隔一小时0**/1**?例1:每隔5秒执行一次:*/5****?例2:每隔5分执行一次:0*/5***?在26分、29分、33分执行一次:026,29,33***?例3......
  • Python爬虫学习五:常用-xpath
    文章目录​​一、xpath解析原理​​​​二、环境的安装​​​​三、如何实例化一个etree对象​​​​第一步:引入对象​​​​第二步:加载对象​​​​方法一:将本地的html文档......
  • 乘风破浪,遇见最佳跨平台跨终端框架.Net Core/.Net生态 - 适用于Entity Framework Core
    什么是EFCoreCLI适用于EntityFrameworkCore的命令行接口(CLI)工具可执行设计时开发任务。例如,可以创建迁移、应用迁移,并为基于现有数据库的模型生成代码。获取EFCore......
  • 数据库的常用术语
    数据模型:(Datamodel)三个要素:数据结构,数据操作,数据约束条件。数据结构(表里面的字段):对象类型的集合,是对静态属性的描述。数据操作(表里面的数据): 是对数据库中的各种对......
  • 基于SqlSugar的开发框架循序渐进介绍(19)-- 基于UniApp+Vue的移动前端的功能介绍
    在之前的SqlSugar系列随笔中,介绍了很多我们关于SqlSugar的开发框架的内容,SqlSugar的开发框架的目的是多前端应用场景,因此其中会包含各种不同的前端应用,前面介绍了基于DevEx......