- 将Department实体的属性从deptCode/college/dean/phone改为deptNo/deptManager/deptPhone/campus - 在bean-ioc.xml中为Department实体添加第二个实例department2用于测试 - 更新主校区和东校区的校园信息配置 - 添加javax.servlet-api-4.0.1.jar到项目依赖库中 - 移除多个废弃的注解配置相关Java类文件 - 清理过时的XML配置文件和项目配置文件main
parent
96d6ea8a40
commit
8343420ba9
@ -1,29 +0,0 @@
|
||||
### IntelliJ IDEA ###
|
||||
out/
|
||||
!**/src/main/**/out/
|
||||
!**/src/test/**/out/
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="commons-logging-1.1.1" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@ -1,6 +0,0 @@
|
||||
<?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/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
</beans>
|
||||
@ -1,17 +0,0 @@
|
||||
package com.ssm.di.annotation.annotation;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class Category {
|
||||
@Value("1")
|
||||
private Integer cid;
|
||||
@Value("蔬菜")
|
||||
private String cname;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Category{cid=" + cid + ", cname='" + cname + "'}";
|
||||
}
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
package com.ssm.di.annotation.annotation;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class Product {
|
||||
@Value("2")
|
||||
private Integer pid;
|
||||
@Value("荷兰豆")
|
||||
private String pname;
|
||||
@Value("12.9")
|
||||
private Double marketPrice;
|
||||
@Value("12.0")
|
||||
private Double shopPrice;
|
||||
@Value("products/f4c77d4e-57ca-4f95-8b03")
|
||||
private String image;
|
||||
|
||||
// 必须重写 toString() 才能输出截图中的格式
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Product{" +
|
||||
"pid=" + pid +
|
||||
", pname='" + pname + '\'' +
|
||||
", marketPrice=" + marketPrice +
|
||||
", shopPrice=" + shopPrice +
|
||||
", image='" + image + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
package com.ssm.di.annotation.annotation;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("com.ssm.di.annotation")
|
||||
public class SpringConfig {
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
package com.ssm.di.annotation.annotation;
|
||||
|
||||
import com.ssm.di.annotation.Category;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
|
||||
com.ssm.di.annotation.Category category = context.getBean(Category.class);
|
||||
System.out.println(category);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue