自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 SSM项目搭建模板

1. 新建Maven项目,添加web框架支持如果新建maven项目的时候没有使用web模板,而是后面添加的,记得在artifact打包的时候添加lib文件夹,把依赖导入到lib文件夹里,否则Tomcat启动会报错。2. 在pom.xml中导入dependency依赖 <!--依赖:Junit, 数据库驱动, 连接池, servlet, jsp, mybatis, mybatis-spring,spring--> <!--Junit单元测试-->

2020-07-20 17:56:08 602

原创 web.xml中 /和/*的区别

web.xml中 /和/*的区别一般在springmvc中我们都会将web.xml中的url配置成 /< url-pattern>/ 会匹配到/login这样的路径型url,不会匹配到模式为*.jsp这样的后缀型url< url-pattern>/ 会匹配所有url:路径型的和后缀型的url(包括/login,.jsp,.js和.html等)因为 springmvc 要使用DispatcherServlet类 处理 前端的 请求,所以配置为< url-patt

2020-07-20 17:53:07 117

原创 SpringMVC中 mvc: default-servlet-handler/的作用

SpringMVC中 <mvc: default-servlet-handler/>的作用背景优雅REST风格的资源URL不希望带 .html 或 .do 等后缀.由于早期的Spring MVC不能很好地处理静态资源,所以在web.xml中配置DispatcherServlet的请求映射,往往使用 *.do 、 *.xhtml等方式。这就决定了请求URL必须是一个带后缀的URL,而无法采用真正的REST风格的URL。如果将DispatcherServlet请求映射配置为"/",则Sprin

2020-07-20 17:52:12 438

原创 mybatis整合spring时数据库连接报错:Access denied for user ‘16060‘@‘localhost‘ (using password: YES),

问题描述错误:Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user ‘admin’@‘localhost’ (using password: YES), mergedContextConfiguration = [MergedContextConfiguration@60dcc9fe testClass……这个错误是因为在jdbc属性文件中起名username会和w

2020-07-20 17:51:40 317 1

原创 xml配置文件的命名空间

Spring的applicationContext.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" xsi:schemaLocation="http://www.springframework.org/

2020-07-20 17:50:58 92

原创 ssm项目的maven依赖

ssm项目的maven依赖pom.xml文件的项目依赖 <!--依赖:Junit, 数据库驱动, 连接池, servlet, jsp, mybatis, mybatis-spring,spring--> <dependencies> <!--Junit单元测试--> <dependency> <groupId>junit</groupId>

2020-07-20 17:49:53 378

原创 spring整合mybatis,spring-dao.xml文件

spring-dao.xml文件配置当我们的spring项目需要和mybatis整合时,除了在resource目录下新建mybatis-config.xml文件外,还需要创建spring-dao.xml文件,内容如下:<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/20

2020-07-20 17:49:02 284

原创 SpringMVC项目的springmvc-servlet.xml文件

springmvc-servlet.xml文件配置只要新建springmvc项目,直接在resource目录下新建springmvc-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"

2020-07-20 17:47:06 534

原创 Idea里搭建SpringMVC项目,启动失败,部署的包下没有lib

问题描述在idea里搭建springMVC项目时候,直接引用了Spring提供的jar,部署到tomcat9的时候,一直报错,classNotFound :DisapatcherServlet,本来以为通过maven引入Spring的包在根目录就行了,结果一直报错。检查配置没问题,lib也在,检查idea部署路径,发现问题了解决办法一般解决方法是方法2方法1:把根目录生成的那个lib,直接复制到项目WEB-INF里了,重新部署,解决方法2:打开项目的project structure,在

2020-07-20 17:44:30 1251 2

原创 解决idea中右侧maven部分项目显示灰色的问题

问题描述:如图在maven项目管理界面,部分项目的颜色是灰色的,表示忽略了pom.xml,项目被隐藏。解决办法打开File-Settings-Maven-ignored Files- 将有对勾的项目点掉即可再次回到项目中,发现自己的项目中的文件夹颜色不对,不要惊慌!只需要将父工程的对应的删除,在添加上,刺激一下即可,如图...

2020-07-20 17:42:33 1802

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除