SSM整合

SSM整合thymeleaf 之前学习SSM的时候前端页面还是一直用jsp搭建的,虽然jsp用着挺不爽但是确实我用了挺久的。 最近学了thymeleaf,发现网上主要的资料还是springboot整合thymeleaf的,很少用springmvc直接整合的 因此根据官网文档试着整合一下 准备工作 thymelef+spring官方文档:https://www.thymeleaf.org/doc/tutorials/3.0/thymeleafspring.html 一个整合了的SSM小应用,在网上随便扒拉了一个简单的整合,简单. 阅读详情

目录

1.原始方式整合准备工作

1.1.原始方式整合

1.2.创建maven工程

1.3.导入Maven坐标

1.4.编写实体类

1.5.编写Mapper接口

1.6.编写Service接口

1.7.编写Service接口实现

1.8.编写Controller

1.9.编写添加页面

1.10.编写列表页面

1.11.编写相应配置文件

1.12.测试添加账户

1.13.测试账户列表

2.Mybatis整合Spring(比原始开发改变的相关东西)

2.1.service接口实现

2.2.Spring配置文件:applicationContext.xml

2.3.MyBatis核心配置文件:sqlMapConfig.xml

1.原始方式整合准备工作

1.1.原始方式整合

CREATE TABLE account(  
    id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(100),
    money DOUBLE(7,2)
) DEFAULT CHARSET UTF8 COMMENT '';

1.2.创建maven工程

1.3.导入Maven坐标

<dependencies>
    <!--spring相关-->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>5.3.20</version>
    </dependency>
    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
      <version>1.8.7</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>5.3.20</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-tx</artifactId>
      <version>5.3.20</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <version>5.3.20</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>5.3.20</version>
    </dependency>

    <!--servlet和jsp-->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.0</version>
    </dependency>

    <!--mybatis相关-->
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.5.8</version>
    </dependency>
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis-spring</artifactId>
      <version>1.3.1</version>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>8.0.29</version>
    </dependency>
    <dependency>
      <groupId>c3p0</groupId>
      <artifactId>c3p0</artifactId>
      <version>0.9.1.2</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
    </dependency>
    <dependency>
      <groupId>jstl</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>

  </dependencies>

1.4.编写实体类

package com.caoyan.domain;

public class Account {
    private Integer id;
    private String name;
    private double money;

    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getMoney() {
        return this.money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

}

1.5.编写Mapper接口

package com.caoyan.mapper;

import java.util.List;

import com.caoyan.domain.Account;

public interface AccountMapper {
    // 保存账户数据
    public void save(Account account);

    // 查询账户数据
    public List<Account> findAll();
}

1.6.编写Service接口

package com.caoyan.service;

import java.util.List;

import com.caoyan.domain.Account;

public interface AccountService {
    // 保存账户数据
    public void save(Account account);

    // 查询账户数据
    public List<Account> findAll();
}

1.7.编写Service接口实现

package com.caoyan.service.impl;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import com.caoyan.domain.Account;
import com.caoyan.mapper.AccountMapper;
import com.caoyan.service.AccountService;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.springframework.stereotype.Service;

@Service("accountService")
public class AccountServiceImpl implements AccountService {

    @Override
    public void save(Account account) {
        // 保存
        try {
            InputStream resourceAsStream = Resources.getResourceAsStream("sqlMapConfig.xml");
            SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(resourceAsStream);
            SqlSession sqlSession = sqlSessionFactory.openSession();
            AccountMapper accountMapper = sqlSession.getMapper(AccountMapper.class);
            accountMapper.save(account);
            sqlSession.commit();
            sqlSession.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    @Override
    public List<Account> findAll() {
        // 查询
        InputStream resourceAsStream;
        try {
            resourceAsStream = Resources.getResourceAsStream("sqlMapConfig.xml");
            SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(resourceAsStream);
            SqlSession sqlSession = sqlSessionFactory.openSession();
            AccountMapper accountMapper = sqlSession.getMapper(AccountMapper.class);
            List<Account> accountList = accountMapper.findAll();
            sqlSession.close();
            return accountList;
        } catch (IOException e) {
            e.printStackTrace();
        }

        return null;
    }

}

1.8.编写Controller

package com.caoyan.controller;

import java.util.List;

import com.caoyan.domain.Account;
import com.caoyan.service.AccountService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/account")
public class AccountController {
    @Autowired
    private AccountService accountService;

    // 保存
    @RequestMapping(value = "/save", produces = "text/html;charset=UTF-8")
    @ResponseBody
    public String save(Account account) {
        accountService.save(account);
        return "保存成功!";
    }

    // 查询
    @RequestMapping("/findAll")
    public ModelAndView findAll() {
        List<Account> accountList = accountService.findAll();
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("accountList", accountList);
        modelAndView.setViewName("accountList");
        return modelAndView;
    }
}

1.9.编写添加页面

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
    <head>
        <title>个人账户信息</title>
    </head>
    <body>
        <h1>保存账户信息表单</h1>
        <form action="${pageContext.request.contextPath}/account/save" method="post">
            用户名称:<input type="text" name="name"><br/>
            账户金额:<input type="text" name="money"><br/>
            <input type="submit" value="保存"><br/>
        </form>
    </body>
</html>

1.10.编写列表页面

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <h1>展示账户数据列表</h1>
    <table border="1">
        <tr>
            <th>账户id</th>
            <th>账户名称</th>
            <th>账户金额</th>
        </tr>

        <c:forEach items="${accountList}" var="account">
            <tr>
                <td>${account.id}</td>
                <td>${account.name}</td>
                <td>${account.money}</td>
            </tr>
        </c:forEach>

    </table>
</body>
</html>

1.11.编写相应配置文件

  • Spring配置文件: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"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
    <!-- 组件扫描 扫描service和mapper -->
    <context:component-scan base-package="com.caoyan">
    <!-- 排除controller的扫描 -->
        <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
    </context:component-scan>
</beans>
  • SpringMVC配置文件:spring-mvc.xml(第四步)
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:context="http://www.springframework.org/schema/context"
       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
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
    <!-- 组件扫描 主要扫描controller -->
    <context:component-scan base-package="com.caoyan.controller"/>
    <!-- 配置mvc注解驱动 -->
    <mvc:annotation-driven/>
    <!-- 内部资源视图解析器 -->
    <bean id="resourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/pages/"/>
        <property name="suffix" value=".jsp"/>
    </bean>
    <!-- 开放静态资源访问权限 -->
    <mvc:default-servlet-handler />
</beans>
  • MyBatis映射文件:AccountMapper.xml(第一步)
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caoyan.mapper.AccountMapper">
    <insert id="save" parameterType="account">
        insert into account values(#{id},#{name},#{money})
    </insert>
    <select id="findAll" resultType="account">
        select * from account
    </select>
</mapper>
  • MyBatis核心文件:sqlMapConfig.xml(第二步)
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <!-- 加载properties文件 -->
    <properties resource="jdbc.properties"></properties>
    <!-- 起别名 -->
    <typeAliases>
        <!-- <typeAlias type="com.caoyan.domain.Account" alias="account" /> -->
        <package name="com.caoyan.domain" />
    </typeAliases>
    <!-- 环境 -->
    <environments default="development">
        <environment id="development">
            <transactionManager type="JDBC"></transactionManager>
            <dataSource type="POOLED">
                <property name="driver" value="${jdbc.driver}" />
                <property name="url" value="${jdbc.url}" />
                <property name="username" value="${jdbc.username}" />
                <property name="password" value="${jdbc.password}" />
            </dataSource>
        </environment>
    </environments>
    <!-- 加载映射 -->
    <mappers>
        <!-- <mapper resource="com/caoyan/mapper/AccountMapper.xml"/> -->
        <package name="com.caoyan.mapper" />
    </mappers>

</configuration>
  • 数据库连接信息文件:jdbc.properties
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/ssm
jdbc.username=root
jdbc.password=123456
  • Web.xml文件:web.xml(第五步)
<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
  <!-- spring监听器 -->
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:applicationContext.xml</param-value>
  </context-param>

  <!-- 乱码过滤器 -->
  <filter>
    <filter-name>CharacterEncodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>CharacterEncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  
  <!-- spring前端控制器 -->
  <servlet>
    <servlet-name>DispatcherServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:spring-mvc.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>DispatcherServlet</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
</web-app>

1.12.测试添加账户

1.13.测试账户列表

2.Mybatis整合Spring(比原始开发改变的相关东西)

2.1.service接口实现

package com.caoyan.service.impl;

import java.util.List;

import com.caoyan.domain.Account;
import com.caoyan.mapper.AccountMapper;
import com.caoyan.service.AccountService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("accountService")
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountMapper accountMapper;

    @Override
    public void save(Account account) {
        accountMapper.save(account);
    }

    @Override
    public List<Account> findAll() {
        return accountMapper.findAll();
    }

}

2.2.Spring配置文件: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"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">

    <!-- 组件扫描 扫描service和mapper -->
    <context:component-scan base-package="com.caoyan">
        <!-- 排除controller的扫描 -->
        <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
    </context:component-scan>
    <!-- 加载properties文件 -->
    <context:property-placeholder location="classpath:jdbc.properties"/>
    <!-- 配置数据源信息 -->
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <property name="driverClass" value="${jdbc.driver}"></property>
        <property name="jdbcUrl" value="${jdbc.url}"></property>
        <property name="user" value="${jdbc.username}"></property>
        <property name="password" value="${jdbc.password}"></property>
    </bean>
    <!-- 配置sessionFactory -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"></property>
        <!-- 加载mybatis核心文件 -->
        <property name="configLocation" value="classpath:sqlMapConfig-spring.xml"></property>
    </bean>
    <!-- 扫描mapper所在的包为mapper创建实现类 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="com.caoyan.mapper"></property>
    </bean>
    <!-- 声明式事务控制 -->
    <!-- 平台事务管理器 -->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"></property>
    </bean>
    <!-- 配置事务增强 -->
    <tx:advice id="txAdvice">
        <tx:attributes>
            <tx:method name="*" />
        </tx:attributes>
    </tx:advice>
    <!-- 事务的aop织入 -->
    <aop:config>
        <aop:advisor advice-ref="txAdvice" pointcut="execution(* com.caoyan.service.impl.*.*(..))" />
    </aop:config>
</beans>

2.3.MyBatis核心配置文件:sqlMapConfig.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>

    <!--定义别名-->
    <typeAliases>
        <!--<typeAlias type="com.caoyan.domain.Account" alias="account"></typeAlias>-->
        <package name="com.caoyan.domain"></package>
    </typeAliases>

</configuration>

【智能制造】- APS系列|05 APS 排产的五大底层算法逻辑 很多人误以为APS只是给生产工单排先后顺序,实则整套系统依托成熟算法体系,完成多维度约束下的最优生产决策在制造业数字化排产普及的当下,依旧有不少制造管理者对APS存在认知误区,将其等同于简易工单排序工具。事实上,专业级高级计划与排程系统,早已脱离单纯按时间排序的基础功能,而是依托一整套成熟完善的底层算法逻辑,整合现场各类生产限制条件,在海量变量中自动推演、筛选、输出最贴合企业经营目标的生产方案。 阅读详情

相关推荐

Docker容器n8n中 read/write files from disk 无法读取容器内文件解决方案

《n8n文件读写Docker部署常见问题解决方案》摘要:针对n8n 1.90.2版本在Docker环境下文件读写失败问题,本文分析常见错误包括路径错误(ENOENT)、权限不足(EACCES)及节点误用问题。核心解决方案为:1)通过-v参数挂载宿主机目录到容器(如/files);2)使用新版Read/WriteFilesfromDisk节点操作文件;3)确保权限设置正确。提供可直接导入的示例工作流JSON,演示从CSV读取到结构化数据处理的全流程。特别强调已部署用户需重新挂载卷的正确操作方式,并附解决方案对

m0_74822402的博客 2184

【问题】 form action="${pageContext.request.contextPath}/login.action"

${pageContext.request.contextPath}是使用的el表达式,获取的是项目的http路径 ${pageContext.request.contextPath}是JSP取得绝对路径的方法,等价于<%=request.getContextPath()%> 。 比如项目名称是demo1在浏览器中输入为http://localhost:8080/demo1/a....

毛兔记录:工作小技巧、遇到的一些典型bug、问题汇总、小知识。 6327

NVIDIA显卡驱动历史版本全攻略:从官网隐藏入口到精准下载

本文详细介绍了如何获取NVIDIA显卡驱动历史版本的完整攻略,包括官网隐藏入口的揭秘、精准筛选驱动版本的技巧以及安装避坑指南。特别针对游戏玩家、创作者和老显卡用户提供了实用建议,帮助用户解决驱动兼容性问题,提升显卡性能。

m2n3o4p5的博客 3745

11. 数据绑定

11.1 数据绑定介绍 在执行程序时,Spring MVC 会根据客户端请求参数的不同,将请求信息中的信息以一定的方式转换并绑定到控制器类方法参数中,这便是数据绑定。 信息处理的步骤 1)Spring MVC将ServletRequest对象传递给DataBinder 2)将处理方法的入参对象传递给DataBinder 3)DataBinder调用 ConversionService 组件进行数据类型转换和数据格式化工作,并将ServletRequest对象中的信息填充到参数对象中。 4)调用Validat

老张的博客 318

C# OpenCvSharp4实战:5分钟搞定工业视觉模板匹配(附完整代码)

本文为C#开发者提供了基于OpenCvSharp4的工业视觉模板匹配实战指南。通过详细的环境搭建、核心原理解析和完整代码示例,重点介绍了如何使用`matchTemplate`函数,特别是`CCoeffNormed`方法,快速实现高精度、抗光照变化的模板匹配,并分享了多目标匹配、图像预处理等工业级优化技巧。

weixin_29053067的博客 505

Windows上MSYS2的安装和使用

MSYS2这个工具我是越用越喜欢,很多东西放在Linux上如鱼得水但是放在Windows上就没那么好用,比如ffmpeg,opencv等直接引用就行了,这个工具真的很省事。接下来带你们看看它的妙用。1、好好研究确实妙用无穷。

jiexijihe945的博客 4143

${pageContext.request.contextPath} 无效-取不到值(已解决)

${pageContext.request.contextPath} 无效-取不到值(已解决) 在学习spring-mvc时,在为了获取请求参数为 List 类型时,写了一个简单的 jsp 页面时,${pageContext.request.contextPath} 无效。 <form action="${pageContext.request.contextPath}/user/request4" method="post"> <input type="text" name="u

yxc852814721的博客 2682

理想L9高通QAM8797座舱域控制器全拆解|全网独家复现 硬件架构升级、电源散热优化、多屏低延迟交互、车机系统赋能高端智能座舱落地

随着智能汽车向舱驾一体、全域智能化、多模交互方向迭代,传统单一功能座舱芯片已无法满足多屏高刷渲染、全车AI语音、车内视觉感知、高速车载通信的叠加算力需求。2026款全新理想L9作为旗舰级智能SUV,全面搭载高通新一代旗舰座舱域控制器QAM8797,搭配自研马赫M100 AI芯片、国产车规主控芯片,构建起高性能、高可靠、低延迟的车载中央计算平台。

getusushu的博客 387

绝对路径${pageContext.request.contextPath}的使用

${pageContext.request.contextPath} 首先,${pageContext.request.contextPath}使用了EL表达式的写法,EL 全名为Expression Language,所有EL都是以 ${ 为起始、以 } 为结尾的。 示例: ${sessionScope.user.sex} 表示从Session的范围中,取得用户的性别。 假若依照之前JSP Scriptlet的写法如下: User user =(User)session.getAttribute(“use

weixin_45638486的博客 1万+

CMOS图像传感器——Remosaic技术

对remosaic技术进行了介绍

沧海一升的博客 9585

32、生物信息学中的符号、缩写及相关概念解析

本文详细解析了生物信息学中常用的符号、缩写及相关概念,涵盖概率理论、函数表示、模型结构、图与集合、维度参数、神经网络、隐藏马尔可夫模型、双向架构、语法系统、系统发育树、微阵列分析以及核方法与支持向量机等多个领域。通过表格和mermaid流程图的形式,系统梳理了各类符号的定义与应用场景,并介绍了常见缩写的全称与意义。文章旨在帮助研究人员准确理解生物信息学中的基础术语,提升对基因表达分析、序列建模、机器学习等技术的理解与应用能力。

rrr55的博客 147

${pageContext.request.contextPath }的使用

利用SSM框架实现一个登入页面的验证 进入登入页面: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head>

qq_45780016的博客 5082

Transformer实战(5)——Hugging Face环境配置与应用详解

本文详细介绍 Transformer 模型的实践应用全流程。首先讲解基于 Anaconda 的环境配置,包括 transformers 库安装及 hf-mirror 镜像加速方案。然后以 BERT 为例,演示分词器使用、文本编码及 fill-mask 等任务实现,对比 PyTorch/TensorFlow 框架差异。接着展示 Hugging Face 社区模型应用,包括 GPT-2 文本生成和零样本分类。最后扩展至多模态领域,使用 CLIP 模型实现零样本图像分类。

盼小辉丶的博客 1万+

SSM框架整合思想及步骤

SSM框架即是将SpringMVC框架、Spring框架、MyBatis框架整合使用。以简化在web开发中繁琐、重复的操作,让开发人员的精力专注于业务处理的开发上。ssm框架根据SpringMVC、Spring、MyBatis三者各自的特性及应用场景对其操作的的业务进行了分割,降低了耦合性。SpringMVC框架位于Controller层,主要为接收用户发起的请求,在接收请求后可进行一定处理(如:通过拦截器的信息验证处理)。在通过处理后SpringMVC会根据请求的路径将请求分发到对应的Controller

发果叁 1万+

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

SSM框架整合

MVC设计模式代表(模型视图控制器) 模式,这种模式用于应用程序的分层开发,解决了应用程序中业务逻辑、数据和界面显示的耦合问题,SSM框架就是实现了MVC设计模式的具体框架。SSM框架分别是指SpringSpringMVC和MyBatis框架的组合。

像污秽一样的博客 2744

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

SSM 整合笔记

微观:将学习的 Spring SpringMVC Mybatis 框架应用到项目中!SpringMVC 框架负责控制层Spring 框架负责整体和业务层的声明式事务管理MyBatis 框架负责数据库访问层宏观:Spring 接管一切(将框架核心组件交给 Spring 进行 IoC 管理),代码更加简洁。SpringMVC 管理表述层、SpringMVC 相关组件Spring管理业务层、持久层、以及数据库相关(DataSource,MyBatis)的组件使用IoC的方式管理一切所需组件。

weixin_57796792的博客 1514

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

SSM整合完整流程

✅作者简介:大家好,我是Leo,热爱Java后端开发者,一个想要与大家共同进步的男人😉😉 🍎个人主页:Leo的博客 💞当前专栏: SSM专栏 ✨特色专栏: MySQL学习 🥭本文内容:SSM整合完整流程 🖥️个人小站 :个人博客,欢迎大家访问 📚个人知识库: 知识库,欢迎大家访问Spring 和 SpringMVC 本身就是同源的,作为 Spring 家族的一个框架,整合不整合都行,我们所说的不整合是指 Spring 和 SpringMVC 创建同一个 IOC 容器,整合是指 Spring 和

分享思想,留下痕迹。 2163

SSM整合过程梳理

框架用的好效率自然高

懒羊羊的博客 2981

ssm整合步骤

IDEA整合SSM 什么是ssm? Spring + SpringMVC + Mybatis 1.整合工程 1.创建Maven工程 方式一:使用Web模板 方式二: 1.在main目录下新建目录webapp 2.建立web工程 注意路径问题 3.配置 Tomcat 基本目录结构就搭建完毕 4.Maven导入相关依赖 Spring SpringMVC Mybatis 数据库连接池,数据库连接驱动 日志,测试单元 pom.xml <?xml version="1.0" encoding="U

CrazyAugust的博客 5435

SpringBoot之整合SSM步骤

传统的JavaWeb开发中,Spring、SpringMVC和MyBatis(SSM)的整合需要繁琐的配置,涉及大量XML文件,而SpringBoot的出现,通过自动配置和起步依赖,极大简化了SSM的整合过程。

aa_hdkf_vg的博客 1390

SSM 整合详细步骤

SSM 整合 第一章环境准备 1、创建数据库和表结构 create database ssm; create table account( id int primary key auto_increment, name varchar(100), money double(7,2), ); 2、创建 Maven 工程 创建ssm_parent父工程(打包方式选择pom,必须的) 创建ssm_web子模块(打包方式是war包) 创建ssm_service子模块(打包方式是jar包) 创建ssm_dao子模

你好,摆渡人的博客 3049

SSM框架整合实战

微观:将学习的Spring SpringMVC Mybatis框架应用到项目中!SpringMVC框架负责控制层Spring 框架负责整体和业务层的声明式事务管理MyBatis框架负责数据库访问层宏观:Spring接管一切(将框架核心组件交给Spring进行IoC管理),代码更加简洁。SpringMVC管理表述层、SpringMVC相关组件Spring管理业务层、持久层、以及数据库相关(DataSource,MyBatis)的组件使用IoC的方式管理一切所需组件实施。

fjdjdj1的博客 2507

SSM整合思路

SSM整合

毕业势必进大厂的博客 1971
上一篇: MyBatis多表查询
下一篇: MyBatis注解开发
Caoyy686868
博客等级 码龄8年 5742粉丝 57原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Caoyy686868

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值