62_Spring整合SpringMVC

2023-12-17

Spring整合SpringMVC

@Configuration
@ComponentScan(basePackages = "com.wnx.springmvc",
        useDefaultFilters = false,
        includeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION,value = Controller.class))
@EnableWebMvc
public class SpringMvcConfig implements WebMvcConfigurer {




    @Override
    public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
        MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
        ObjectMapper objectMapper = new ObjectMapper();

        //1.日期格式化和 时区格式化
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        objectMapper.setDateFormat(simpleDateFormat);
        objectMapper.setLocale(Locale.getDefault());
        objectMapper.setTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault()));


        //3.设置中文编码格式
        List<MediaType> list = new ArrayList<MediaType>();
        list.add(MediaType.APPLICATION_JSON);


        //4.加入LocalDate LocalDateTime LocalTime序列化器和反序列化器
        SimpleModule simpleModule = new SimpleModule();


       //5.把Long类型序列化为String类型
        simpleModule.addSerializer(Long.class, ToStringSerializer.instance);

        objectMapper.registerModules(simpleModule,new JavaTimeModule());
        mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
        mappingJackson2HttpMessageConverter.setSupportedMediaTypes(list);

        converters.add(0, mappingJackson2HttpMessageConverter);
    }

     //使用默认的Servlet处理静态资源
    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }
    
    //文件上传
    @SneakyThrows
    @Bean
    public MultipartResolver commonMultipartResolver(){
        CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
        commonsMultipartResolver.setDefaultEncoding("UTF-8");
        commonsMultipartResolver.setMaxUploadSize(1024000L);
        commonsMultipartResolver.setMaxUploadSize(1024000L);
        commonsMultipartResolver.setUploadTempDir(new FileSystemResource("/WEB-INF/temp"));
        commonsMultipartResolver.setMaxInMemorySize(102400);
        return commonsMultipartResolver;
    }

	//数据校验
    @Bean
    public LocalValidatorFactoryBean localValidatorFactoryBean(){
        LocalValidatorFactoryBean localValidatorFactoryBean = new LocalValidatorFactoryBean();
        localValidatorFactoryBean.setProviderClass(HibernateValidator.class);
        return localValidatorFactoryBean;
    }


	//视图解析
    @Bean
    public SpringResourceTemplateResolver springResourceTemplateResolver(){
        SpringResourceTemplateResolver springResourceTemplateResolver = new SpringResourceTemplateResolver();
        springResourceTemplateResolver.setPrefix("/WEB-INF/");
        springResourceTemplateResolver.setSuffix(".html");
        springResourceTemplateResolver.setCharacterEncoding("UTF-8");
        springResourceTemplateResolver.setOrder(1);
        springResourceTemplateResolver.setTemplateMode("HTML");
        springResourceTemplateResolver.setCacheable(false);
        return springResourceTemplateResolver;
    }

    @Bean
    public SpringTemplateEngine springTemplateEngine(SpringResourceTemplateResolver springResourceTemplateResolver){
        SpringTemplateEngine springTemplateEngine = new SpringTemplateEngine();
        springTemplateEngine.setTemplateResolver(springResourceTemplateResolver);
        return springTemplateEngine;
    }
    @Bean
    public ViewResolver viewResolver(SpringTemplateEngine springTemplateEngine){
        ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver();
        thymeleafViewResolver.setCharacterEncoding("UTF-8");
        thymeleafViewResolver.setTemplateEngine(springTemplateEngine);
        return thymeleafViewResolver;
    }


}
@Component
public class CustomObjectMapper  extends ObjectMapper {
    public CustomObjectMapper() {
        //1.Date处理
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        this.setDateFormat(sdf);
        this.setTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault()));
        this.setLocale(Locale.getDefault());



        SimpleModule simpleModule = new SimpleModule();

        //2.LocalDate LocalDateTime LocalTime 处理
        simpleModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        simpleModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
        simpleModule.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern("HH:mm:ss")));
        simpleModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        simpleModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
        simpleModule.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern("HH:mm:ss")));

        //3.把Long类型序列化为String类型
        simpleModule.addSerializer(Long.class, ToStringSerializer.instance);

        this.registerModule(simpleModule);
        this.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
    }
}
package com.wnx.springmvc.config;

import com.alibaba.druid.pool.DruidDataSource;
import com.wnx.springmvc.model.Dept;
import com.wnx.springmvc.model.Emp;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.*;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;

@Configuration
@ComponentScan(
        basePackages = "com.wnx.springmvc",
        excludeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION,classes = Controller.class)})
@PropertySource("classpath:/jdbc.properties")
@EnableAspectJAutoProxy      
@EnableTransactionManagement
public class SpringConfig {
    
    @Bean
    public DataSource dataSource(@Value("${jdbc.username}") String username,
                                 @Value("${jdbc.password}") String password,
                                 @Value("${jdbc.driverClassName}")String driverClassName,
                                 @Value("${url}") String url){
          DruidDataSource dataSource = new DruidDataSource();
          dataSource.setUsername(username);
          dataSource.setPassword(password);
          dataSource.setDriverClassName(driverClassName);
          dataSource.setUrl(url);
          return dataSource;


    }
    
     @Bean
    public TransactionManager transactionManager(DataSource dataSource){
        DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
        dataSourceTransactionManager.setDataSource(dataSource);
        return dataSourceTransactionManager;
    }

    @Bean
    public MapperScannerConfigurer mapperScannerConfigurer(){
        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        mapperScannerConfigurer.setBasePackage("com.wnx.springmvc.mapper");
        return mapperScannerConfigurer;
    }
    

    @Bean
    public MybatisSqlSessionFactoryBean sqlSessionFactoryBean(DataSource dataSource, GlobalConfig globalConfig, MybatisPlusInterceptor mybatisPlusInterceptor){
        MybatisSqlSessionFactoryBean mybatisSqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();
        mybatisSqlSessionFactoryBean.setDataSource(dataSource);
        mybatisSqlSessionFactoryBean.setTypeHandlersPackage("com.wnx.springmvc.model");
        mybatisSqlSessionFactoryBean.setTypeEnumsPackage("com.wnx.springmvc.enumerate");
        mybatisSqlSessionFactoryBean.setGlobalConfig(globalConfig);
        mybatisSqlSessionFactoryBean.setPlugins(mybatisPlusInterceptor);
        return mybatisSqlSessionFactoryBean;
    }
    
    @Bean
    public GlobalConfig globalConfig(){
        GlobalConfig globalConfig = new GlobalConfig();
        GlobalConfig.DbConfig dbConfig = new GlobalConfig.DbConfig();
        dbConfig.setIdType(IdType.AUTO);
        dbConfig.setTablePrefix("t_");
        globalConfig.setDbConfig(dbConfig);
        return globalConfig;
    }
    
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
        OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor = new OptimisticLockerInnerInterceptor();
        paginationInnerInterceptor.setDbType(DbType.MYSQL);
        List<InnerInterceptor> list = new ArrayList<>();
        list.add(paginationInnerInterceptor);
        list.add(optimisticLockerInnerInterceptor);
        mybatisPlusInterceptor.setInterceptors(list);
        return mybatisPlusInterceptor;
    }


}
package com.wnx.springmvc.config;

import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.filter.HiddenHttpMethodFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

import javax.servlet.Filter;

public class WebXmlConfig extends AbstractAnnotationConfigDispatcherServletInitializer {

    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{SpringConfig.class};
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{SpringMvcConfig.class};
    }

    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }

    @Override
    protected Filter[] getServletFilters() {
        CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter();
        characterEncodingFilter.setEncoding("UTF-8");
        characterEncodingFilter.setForceRequestEncoding(true);
        characterEncodingFilter.setForceResponseEncoding(true);


        HiddenHttpMethodFilter hiddenHttpMethodFilter = new HiddenHttpMethodFilter();

        return new Filter[] {characterEncodingFilter,hiddenHttpMethodFilter};
    }
}

XML配置:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
<!--    1.加载Spring父容器-->
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring.xml</param-value>
        </context-param>
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>

    <!-- 2.加载子容器 -->
    <servlet>
        <servlet-name>spring-mvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>spring-mvc</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <!--3.配置字符编码过滤器-->
    <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>
        <init-param>
            <param-name>forceRequestEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>forceResponseEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>characterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!--4.配置支持PUT DELETE请求-->
    <filter>
        <filter-name>hiddenHttpMethodFilter</filter-name>
        <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>hiddenHttpMethodFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>
  • spring-mvc-servlet.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:mvc="http://www.springframework.org/schema/mvc"
       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/mvc
	http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
    <context:component-scan base-package="com.wnx.springmvc" use-default-filters="false">
        <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
    </context:component-scan>      
    
       
    <mvc:default-servlet-handler/>

   
        <bean id="httpMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
        <property name="objectMapper" ref="customObjectMapper"/>
    </bean>
    <mvc:annotation-driven>
        <mvc:message-converters>
            <ref bean="httpMessageConverter"/>
        </mvc:message-converters>
    </mvc:annotation-driven>
    
    
 
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="defaultEncoding" value="UTF-8"/>
        <property name="maxUploadSizePerFile" value="1024000"/>
        <property name="maxUploadSize" value="1024000"/>
        <property name="uploadTempDir" value="WEB-INF/temp"/>
        <property name="maxInMemorySize" value="102400"/>
    </bean>
    

    
    <bean id="validatorFactoryBean" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
        <property name="providerClass" value="org.hibernate.validator.HibernateValidator"/>
    </bean>
       
    
    <bean id="templateResolver" class="org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver">
        <property name="prefix" value="/WEB-INF/"/>
        <property name="suffix" value=".html"/>
        <property name="characterEncoding" value="UTF-8"/>
        <property name="order" value="1"/>
        <property name="templateMode" value="HTML"/>
        <property name="cacheable" value="false"/>
    </bean>
    
    <bean id="templateEngine" class="org.thymeleaf.spring5.SpringTemplateEngine">
        <property name="templateResolver" ref="templateResolver"/>
    </bean>
    
    <bean id="viewResolver" class="org.thymeleaf.spring5.view.ThymeleafViewResolver">
        <property name="templateEngine" ref="templateEngine"/>
        <property name="characterEncoding" value="UTF-8"/>
    </bean>
    
</beans>
@Component
public class CustomObjectMapper  extends ObjectMapper {
    public CustomObjectMapper() {
        //1.Date处理
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        this.setDateFormat(sdf);
        this.setTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault()));
        this.setLocale(Locale.getDefault());



        SimpleModule simpleModule = new SimpleModule();

        //2.LocalDate LocalDateTime LocalTime 处理
        simpleModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        simpleModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
        simpleModule.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern("HH:mm:ss")));
        simpleModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        simpleModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
        simpleModule.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern("HH:mm:ss")));

        //3.把Long类型序列化为String类型
        simpleModule.addSerializer(Long.class, ToStringSerializer.instance);

        this.registerModule(simpleModule);
        this.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
    }

  • spring.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:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans.xsd
	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd">

    <context:component-scan base-package="com.wnx.springmvc" use-default-filters="true">
       <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
    </context:component-scan>

    <context:property-placeholder location="classpath*:jdbc.properties"/>
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
        <property name="username" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>
        <property name="driverClassName" value="${jdbc.driverClassName}"/>
        <property name="url" value="${jdbc.url}"/>
    </bean>

    <bean id="dataSourceTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <tx:annotation-driven transaction-manager="dataSourceTransactionManager"/>

    <aop:aspectj-autoproxy/>

    <bean id="globalConfig" class="com.baomidou.mybatisplus.core.config.GlobalConfig">
        <property name="dbConfig">
            <bean class="com.baomidou.mybatisplus.core.config.GlobalConfig.DbConfig">
                <property name="idType" value="AUTO"/>
                <property name="tablePrefix" value="t_"/>
            </bean>
        </property>
    </bean>

    <bean id="sqlSessionFactory" class="com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="typeAliasesPackage" value="com.wnx.springmvc.model"/>
        <property name="typeEnumsPackage" value="com.wnx.springmvc.enumerate"/>
        <property name="globalConfig" ref="globalConfig"/>
    </bean>

    <bean id="mybatisPlusInterceptor" class="com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor">
        <property name="interceptors">
            <list>
                <bean class="com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor"/>
                <bean class="com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor"/>
            </list>
        </property>
    </bean>

    <bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
           <property name="basePackage" value="com.wnx.springmvc.mapper"/>
    </bean>
</beans>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

62_Spring整合SpringMVC 的相关文章

  • 常用Web安全扫描工具合集

    漏洞扫描是一种安全检测行为 更是一类重要的网络安全技术 它能够有效提高网络的安全性 而且漏洞扫描属于主动的防范措施 可以很好地避免黑客攻击行为 做到防患于未然 那么好用的漏洞扫描工具有哪些 答案就在本文 1 AWVS Acunetix We

随机推荐

  • 八大排序(希尔排序)

    上篇文章我们来看了看插入排序是怎么实现的 本章内容就是在插入排序的基础上完成希尔排序 希尔排序是一个比较强大的排序 我们希尔排序的时间复杂度是比较难算的 这里直接给出的结论就是时间复杂度就是O N 1 3 比较难算的原因就是我们每一次的次数
  • 【亚马逊】2025届暑期实习生 提前批!

    传音控股 重庆 校招待遇 统一给这些23届秋招毁意向 毁约的无良公司发封感谢信 互联网大厂 VS 体制内 薪资福利大对比 wxg 第一周实习感受与总结 1 2 5SlAM岗面经汇总 slam算法岗24届实习 0offer选手总结 211本硕
  • glu32.dll文件缺失导致程序无法运行问题

    其实很多用户玩单机游戏或者安装软件的时候就出现过这种问题 如果是新手第一时间会认为是软件或游戏出错了 其实并不是这样 其主要原因就是你电脑系统的该dll文件丢失了或没有安装一些系统软件平台所需要的动态链接库 这时你可以下载这个glu32 d
  • 完美解决msvcr100.dll丢失的三个方法,亲测有效

    在计算机操作中 我们常遇到故障提醒 如 msvcr100 dll丢失 这个问题通常会导致某些程序无法正常运行 给用户带来困扰 为了解决这个问题 网上有很多关于如何修复msvcr100 dll丢失的方法 在本文中 我将介绍三种常见的解决方法
  • 题解 | #输出单向链表中倒数第k个结点#

    滴滴前端日常实习一面 字节跳动前端日常实习 一面 Cider秋招一二面 已拒 贝壳编程题题解 山东offer选择 求助 选择华为还是中电14所 写论文 写论文 华为 煞笔公司 华为待遇问题 已接offer 字节跳动飞书运营实习面经 华为 煞
  • fl studio20中文内测版下载2024最新完美实现汉化

    fl studio20是一款众所周知的水果编曲软件 能够剪辑 混音 录音 它的矢量界面能更好用在4K 5K甚至8K显示器上 还可以可以编曲 剪辑 录音 混音 让你的计算机成为全功能录音室 不论是在功能上面还是用户界面上都是数一数二的 但该软
  • yolov5单目测距+速度测量+目标跟踪

    要在YOLOv5中添加测距和测速功能 您需要了解以下两个部分的原理 单目测距算法 单目测距是使用单个摄像头来估计场景中物体的距离 常见的单目测距算法包括基于视差的方法 如立体匹配 和基于深度学习的方法 如神经网络 基于深度学习的方法通常使用
  • 题解 | #输出单向链表中倒数第k个结点#

    滴滴前端日常实习一面 字节跳动前端日常实习 一面 Cider秋招一二面 已拒 贝壳编程题题解 山东offer选择 求助 选择华为还是中电14所 写论文 写论文 华为 煞笔公司 华为待遇问题 已接offer 字节跳动飞书运营实习面经 华为 煞
  • 题解 | #复制部分字符串#

    拒了华为 重回0 offer 目前在大三 寒假想找个实习 退役大学生 如题 uu们帮忙看看 25届 没有实习过 没有背过八股文 心里感觉很不稳 下学期想去暑期实习 uu们 德赛西威鸽 在中国电信公司工作一年后 我提桶跑路 东北辽宁就业求职好
  • 24届双非一本想转行测试,不知道从哪开始学,求佬指教

    避雷西安华为海思某部门 四大行软开校招值得去吗 细节见品格 北京下大雪后的各大厂动作 回暖分析 战绩结算 on 赛文X 选offer 找实习需要实习经历 华为小奖状 夸夸我导师 别羡慕我 嘿嘿 华为od前端技术面 华为海思本科14级 国家计
  • Deep learning 八

    2 使用预训练的词嵌入 有时可用的训练数据很少 以至于只用手头数据无法学习适合特定任务的词嵌人 那么可以从预计算的嵌人空间中加载嵌入向量 这个嵌人空间是高度结构化的 并且具有有用的属性 即抓住了语言结构的一般特点 而不是在解决问题的同时学习
  • Go 语言中切片的使用和理解

    切片与数组类似 但更强大和灵活 与数组一样 切片也用于在单个变量中存储相同类型的多个值 然而 与数组不同的是 切片的长度可以根据需要增长和缩小 在 Go 中 有几种创建切片的方法 使用 datatype values 格式 从数组创建切片
  • 开题报告-基于SpringBoot的求职招聘系统的设计与实现

    一 选题的根据 由于临近毕业季 同学们也即将踏上自己的岗位 择业也成为了同学们当下最为关心的问题 为了能够更加方便的服务同学们找工作 最快最有效率的方式莫过于计算机网络 所以我就因此开发了这一个求职招聘系统 为广大求职者和各企业的人事单位提
  • 24届双非一本想转行测试,不知道从哪开始学,求佬指教

    避雷西安华为海思某部门 四大行软开校招值得去吗 细节见品格 北京下大雪后的各大厂动作 回暖分析 战绩结算 on 赛文X 选offer 找实习需要实习经历 华为小奖状 夸夸我导师 别羡慕我 嘿嘿 华为od前端技术面 华为海思本科14级 国家计
  • 介绍一下傻傻分不清的两个兄弟:过滤器和拦截器之拦截器

    那么拦截器又是什么呢 它跟过滤器又有什么区别呢 实际上 拦截器可以被视为一种对过滤器的封装 在Spring框架中 拦截器提供了更加灵活和强大的功能 可以与Spring MVC等框架无缝集成 并且通常用于处理请求的前置和后置逻辑 拦截器可以实
  • FLStudio20最新2024年中文汉化版

    FLStudio21 0 2 3中文版完整下载是最好的音乐开发和制作软件也称为水果循环 它是最受欢迎的工作室 因为它包含了一个主要的听觉工作场所 最新 FL 有不同的功能 如它包含图形和音乐音序器 帮助您使完美的配乐在一个美妙的方式 此程序
  • 讯飞AI算法挑战大赛-校招简历信息完整性检测挑战赛-三等奖方案

    前言 本文公开了 讯飞AI算法挑战大赛 校招简历信息完整性检测挑战赛 赛道的技术方案和代码 本次比赛主要采用 pdf解析 和 特征工程 的方法 通过使用 lightgbm 的树模型10折交叉验证进行 二分类 的任务 最终取得三等奖的成绩 一
  • 【万字长文】搭建企业级知识库检索增强的大模型对话系统

    01 背景 ChatGPT和通义千问等大语言模型 LLM 凭借其强大的自然语言处理能力 正引领着人工智能技术的革命 但LLM在生成回复时 在 事实性 实时性 等方面存在天然的缺陷 很难直接被用于客服 答疑等一些需要精准回答的领域知识型问答场
  • React脚手架搭建

    React脚手架 脚手架 可以快速构建项目的基本架构 脚手架安装命令 可全局安装脚手架 创建项目 来到当前目录下 create react app 项目名 不要大写字母 运行项目 进到项目里 在项目目录下 执行 npm start 启动完项
  • 62_Spring整合SpringMVC

    Spring整合SpringMVC Configuration ComponentScan basePackages com wnx springmvc useDefaultFilters false includeFilters Comp