spring入门
文章平均质量分 54
TRACY吹西
热爱
展开
-
报错已解决: uri is not registered,unable to import maven project
报错描述解决方法- 选中红字- 按alt enter- 选择fetch external resource附言- 选中部分红字即可, 选中全部也行- 报红原因是: idea或maven没有加载全所需资源, 需开发者手动添加- 有个高频回答说用设置idea/setting/schemaxxx的方式解决, 我没有在setting下找到schemaxxx...原创 2022-03-07 11:02:46 · 128 阅读 · 0 评论 -
servlet导包报红[已解决]
servlet导包报红问题如图所示环境描述:maven的pom文件中已导入servlet依赖,idea左下角lib中包含servlet-api.jar解决方案方案A:借鉴网友经验,做以下操作- idea-project structure-libraries照上面路径进来以后,此时页面有2个+加号,点击左边的+加号,有3个选项,选择java,然后找到tomcat.lib.servlet-api.jar,确认,确认,确认- 然鹅还是报红方案B:新建一个项目- 搭建基本环境- 重原创 2022-01-20 13:37:32 · 2381 阅读 · 0 评论 -
使用set方法实现DI依赖注入
使用set方法实现DI依赖注入通过写set方法,注入set方法,达到”从spring容器获取的service bean内部包含dao对象”的目的[开发步骤]- dao实现类中写set方法- xml中配置set方法- 测试类中无需改动,此时从spring容器获取service对象默认包含dao对象MODULE:jSpringAbccom.it.service包UserService接口package com.it.service;public interface U原创 2022-01-17 14:48:45 · 297 阅读 · 0 评论 -
【报错已解决】ApplicationContext报红,已解决
## 目录1.原代码2.出现问题的代码3.正确写法4.描述##1.原代码<?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=" h.原创 2021-12-03 19:38:15 · 6104 阅读 · 0 评论 -
公式:项目的pom.xml这样写可引入spring依赖
<?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/xsd/ma.原创 2021-12-02 00:01:01 · 312 阅读 · 0 评论 -
公式:使用spring创建对象
## 公式:使用spring创建对象```//创建一个实体类``````//bean,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:schemalocati...原创 2021-12-01 23:59:30 · 73 阅读 · 0 评论