zoukankan      html  css  js  c++  java
  • Spring bean

    1.Spring bean


    1)编写各个实体类
    Java 各个类,描述对象

    2)声明spring的配置文件
    <?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>

    3)在spring配置文件中,配置各个实体类(bean)
    <beans ...>
    <!-- 配置各个实体类,常用属性 -->
    <!-- bean的配置,id 在容器中的唯一标识;class 实体类的位置路径;ref="" 容器中的bean 的引用,值为bean 的id; -->
    <bean id="" class="">
    <!-- bean 的属性配置;配置实体类成员变量的值,name 是实体类的属性名(成员变量),value 是属性的值,ref 是对bean 的引用(与value互斥); -->
    <property name="" value="" ref=""></property>
    </bean>
    </beans>

  • 相关阅读:
    页面框架布局
    socket、tcp、udp、http 的认识及区别
    servlet验证码的设置
    java换行符
    如何在jsp里禁止session
    EL和JSTL表达式
    C标签
    request与response
    文件上传与下载—>struts
    页面跳转
  • 原文地址:https://www.cnblogs.com/bwcode/p/7097576.html
Copyright © 2011-2022 走看看