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

  • 相关阅读:
    sklearn 数据预处理1: StandardScaler
    Gitlab利用Webhook实现Push代码后的Jenkins自动构建
    Shell脚本-自动化部署WEB
    Jenkins可用环境变量以及使用方法
    Docker常用命令
    nginx中root和alias的区别
    gitlab+jenkins=自动化构建
    Spring Boot2.0:使用Docker部署Spring Boot
    Maven内置属性、POM属性
    navicat连接mysql出现Client does not support authentication protocol requested by server解决方案
  • 原文地址:https://www.cnblogs.com/xiao-c-s/p/12419671.html
Copyright © 2011-2022 走看看