0.为什么要使用Spring

https://www.cnblogs.com/zmmi/p/7922186.html

1. 下载jar包

https://blog.csdn.net/qq_43540133/article/details/88357857参考此博客

2. 注意建立的是web项目

package com.tutorialspoint;

public class HelloWorld {
private String message;
public void setMessage(String message){
this.message = message;
}
public void getMessage(){
System.out.println("Your Message : " + message);
}
}

  

package com.tutorialspoint;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class MainApp {
public static void main(String[] args) {
ApplicationContext context =
new ClassPathXmlApplicationContext("Beans.xml");
HelloWorld obj = (HelloWorld) context.getBean("helloWorld");
obj.getMessage();
}
}

  

<?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-3.0.xsd"> <bean id="helloWorld" class="com.tutorialspoint.HelloWorld">
<property name="message" value="Hello World!"/>
</bean> </beans>

  

最新文章

  1. MVC5 Entity Framework学习之Entity Framework高级功能(转)
  2. Jquery设置Cookie
  3. 数据库Error:The ScriptCollection in ScriptName not find
  4. python反转字符串(简单方法)及简单的文件操作示例
  5. 10个 iOS 用户暂可以嘲笑 Android 的特点
  6. JedisPool使用原理和源代码
  7. 解决mac下eclipse字体模糊
  8. 1198: [HNOI2006]军机调度 - BZOJ
  9. 转 json数组对象和对象数组
  10. windows 配置 Scheme + Emacs 编程环境
  11. Certificate downloaded from cloudexpress:11443 is invalid
  12. BZOJ 3160: 万径人踪灭 [fft manacher]
  13. CentOS命令修改系统时间同步
  14. 桶排序/基数排序(Radix Sort)
  15. ●Splay的一些题
  16. 同一脚本sh 脚本名 报Syntax error: &quot;(&quot; unexpected而./脚本名不报错,求解!!
  17. 【vue】vue +element 搭建项目,加(解)密
  18. 使用Python的http.server实现一个简易的Web Api对外提供HanLP拼音转换服务
  19. Mathematica 11.1.0 下载及注册流程
  20. 【做题】neerc2017的A、C、I、L

热门文章

  1. WPF学习笔记五之MVVM
  2. jmeter 登陆--查询存在否--&gt;新建客户--&gt;查询存在否 + 压测
  3. LVS-DR模式搭建
  4. html中实现数据的显示和隐藏
  5. koa2第一天
  6. C语言数据结构——第二章 线性表
  7. 页面在谷歌浏览器和IE浏览器顶部多出空白行,火狐显示正常
  8. 【网易官方】极客战记(codecombat)攻略-地牢-焰中舞动
  9. 【网易官方】极客战记(codecombat)攻略-地牢-囚犯
  10. Scanner的hasNext()方法