zoukankan      html  css  js  c++  java
  • ssh1

    概念
    ssh
    :linux远程访问授权
    :Struts spring hibernate
    类要加get和set
    :spring-webmvc spring-ioc hibernate
    ssm/ssi
    :Struts spring mybatis3.0(ibatis2.0)
    :spring-webmvc spring-ioc mybatis3.0(ibatis2.0)

    插件
    <plugins>
    <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
    <source>1.8</source>
    <target>1.8</target>
    </configuration>
    </plugin>
    </plugins>


    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">
    <bean class="com.yvdedu.testmaven.ml.A" />


    <bean class="com.yvdedu.testmaven.ml.A" scope="singleton">
    scope默认为singleton单例,prototype原型,决定类A创建一个还是多个
    <property name="url" value="jdbc:mysql://xx"/>
    </bean>

    private Properties cfgs;
    <property name="cfgs>
    <props>
    <prop key="jdbc" >abc</prop>
    <prop key= "user" >root</prop>
    <props>
    <property>

    <property name= "cfgs">
    <value>
    url=jdbc:mysql://xx
    user=root
    </value>
    </property>
    </beans>

    类参数
    <?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 class="com.yvdedu.testmaven.ml.A">
    <property name="c" ref="c"/>
    </bean>
    <bean id="c" class="com.yvdedu.testmaven.m2.C">
    </bean>
    </beans>
    依赖
    <dependencies>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>5.1.9.RELEASE</version>
    </dependency>
    </dependencies>

    调用类
    ApplicationContext context = new ClassPathXmlApplication(“applicationContext.xml");
    context.getBen(A.class).hello();

    创建一个jdbc.properties文件
    url=jdbc:mysql://xx
    user=root

  • 相关阅读:
    通过ip找mac
    python开发总结
    iptables 通用语句
    运行pyqt4生成py文件增加代码
    re正则match、search、findall、finditer函数方法使用
    python list 字符串排序
    读取yaml文件小方法
    递归解析字典小方法
    assert 断言
    格式化字符串——初级% 和format
  • 原文地址:https://www.cnblogs.com/xiao-c-s/p/12419671.html
Copyright © 2011-2022 走看看