zoukankan      html  css  js  c++  java
  • 第一个spring简单的helloworld

    spring 是一个开源的框架 也是轻量级框架

    1、导入jar包 spring的版本 4.0

    目录: spring-framework-4.0.0.RELEASE-libs 下的jar  spring最基本的jar

    2、spring必须依赖的日志jar

    3、写一个配置文件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/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="helloWorld" class="com.atguigu.spring.helloworld.HelloWorld" >

    <property name="userName" value="spring"></property>
    </bean>

    </beans>

    4、hellowworld的java类

    5、main方法

    spring的第一个helloworld的程序写完了

     如果不用 spring 创建对象

    HelloWorld hello = new HelloWorld();

    赋值

    hello.setName("spring");

  • 相关阅读:
    hdu2588-GCD-(欧拉函数+分解因子)
    欧拉定理及其扩展定理公式
    hdu2973-YAPTCHA-(欧拉筛+威尔逊定理+前缀和)
    hdu5391-Zball in Tina Town-威尔逊定理(假证明)
    deleted
    deleted
    deleted
    deleted
    deleted
    deleted
  • 原文地址:https://www.cnblogs.com/chengxuyuanIng/p/10733261.html
Copyright © 2011-2022 走看看