当前位置: 首页 > news >正文

海南省两学一做网站dw制作一个环保网站模板下载

海南省两学一做网站,dw制作一个环保网站模板下载,提升学历的十大好处,网站模版html前言 最近想着把大火的deepseek 迁移到小程序里,基于刷题小程序的数据库做一个RAG应用,来进一步扩展答案解析,帮助用户解答相关问题。但是由于之前做的项目都要老了,并不支持spring 的AI模块,因此,我打算先…

前言

最近想着把大火的deepseek 迁移到小程序里,基于刷题小程序的数据库做一个RAG应用,来进一步扩展答案解析,帮助用户解答相关问题。但是由于之前做的项目都要老了,并不支持spring 的AI模块,因此,我打算先升级一下系统。

一、升级JDK 1.8 到 JDK 17

1、首先从官网上下载一个JDK17的包,windows系统可能有这两种包(压缩包和安装包)

直接下载压缩包,放在一个中文目录下,然后修改环境变量。 

 然后看一下java版本 java --version 是否修改成功。

 修改项目中的设置 如下

 

二、升级Springboot 2.x 到 Springboot 3.x  

 修改pom文件

    <parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.2.0</version><relativePath/></parent>
    <properties><java.version>17</java.version></properties>

这里面需要注意的东西还挺多的

1、javax.servlet.*相关的类找不到,需要切换依赖为jakarta.servlet。修改javax.servlet.*为jakarta.servlet.*。

		<!--jakarta.servlet start --><dependency><groupId>jakarta.servlet</groupId><artifactId>jakarta.servlet-api</artifactId></dependency><!--jakarta.servlet end -->

 2.、mybatis-plus-boot-starter

		<!-- mybatis-plus start--><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-spring-boot3-starter</artifactId><version>3.5.5</version></dependency><!-- mybatis-plus end-->

 3、redis

spring.data.redis.host=127.0.0.1
#Redis服务器连接端口
spring.data.redis.port=6379
#连接池最大连接数(使用负值表示没有限制)
spring.data.redis.lettuce.pool.max-active=20
#连接池最大阻塞等待时间(使用负值表示没有限制)
spring.data.redis.lettuce.pool.max-wait=-1
#连接池中的最大空闲连接
spring.data.redis.lettuce.pool.max-idle=5
#连接池中的最小空闲连接
spring.data.redis.lettuce.pool.min-idle=0
#连接超时时间(毫秒)
spring.data.redis.timeout=1800000

4、commons-pool2

Spring Boot 的 spring-boot-starter-data-redis 依赖了 Lettuce 作为 Redis 客户端。

Lettuce 依赖于 commons-pool2 来实现连接池功能。

因此我们也需要更新一下commons-pool2的版本。

        <dependency><groupId>org.apache.commons</groupId><artifactId>commons-pool2</artifactId><version>2.11.1</version></dependency>

4、Spring-Security 

咋WebSecurityConfig显示的注册authenticationManager为一个Bean

    @Beanpublic AuthenticationManager authenticationManager(AuthenticationConfiguration config) throws Exception {return config.getAuthenticationManager();}

使用SecurityFilterChain替代WebSecurityConfigurerAdapter;

@Beanpublic SecurityFilterChain securityFilterChain(HttpSecurity http,CustomizeAuthenticationEntryPoint customizeAuthenticationEntryPoint,CustomizeAccessDeniedHandler customizeAccessDeniedHandler) throws Exception {http.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED)).authenticationProvider(thirdLoginAuthenticationProvider).authorizeHttpRequests(authorize -> authorize.requestMatchers("/swagger-resources/configuration/ui","/swagger-resources","/swagger-resources/configuration/security","/swagger-ui.html",).permitAll().anyRequest().authenticated()).exceptionHandling(exception -> exception.accessDeniedHandler(customizeAccessDeniedHandler).authenticationEntryPoint(customizeAuthenticationEntryPoint)).cors(cors -> cors.configure(http)).csrf(csrf -> csrf.disable());return http.build();}

Spring-Security 6.x的版本中,对于session的管理也发生了一些变化,需要手动将 SecurityContext 保存到 HttpSession 中。

        HttpSession session = request.getSession();session.setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY, SecurityContextHolder.getContext());

修改到这里位置,就可以启动项目了。

http://www.yayakq.cn/news/80953/

相关文章:

  • 企业网站建设要注意哪方面国家信息企业公示系统查询
  • 做豆腐交流经验的网站做网站设计需要哪些软件
  • 无锡市政建设集团有限公司网站广告网站布局
  • 完全的图片宣传网站怎么做织梦网站中的对话框怎摸做
  • 怎么用手机创造网站不用付费就可以看亏亏的app
  • 怎么看一个网站是谁做的org域名不能注册了
  • 租一个服务器要多少钱成都网站建设优化公司
  • 网站的配色技巧厦门做网站推广
  • 网站如何做提现功能西宁网站建设公司哪家好
  • 西安建网站网站推广不关网站备案
  • 崇信县门户网站领导动态网站更换服务器 备案
  • 网络营销的网站分类有苏州网站建设开发公司
  • 工厂的网站在哪里做的建设企业网站企业网上银行登录官网下载
  • 淄博外贸网站哪家好口碑好的常州网站优化
  • 网站开发需要数据库企业免费邮箱注册申请
  • 怎样维护网站达内ui设计培训费用
  • 淄博网站建设0533cl全媒体广告代理加盟
  • 分析网站网站网站制作深
  • 怎样免费做网站推广广点通都有哪些平台投放
  • 玩具租赁系统网站开发与实现设计网页的一般步骤
  • 在凡科做网站公司排名的网站
  • 宁德市城乡建设网站聊城网站开发
  • 中国住房城乡建设部官方网站佛山做企业网站的公司
  • 张家口万全区建设网站导入数据wordpress
  • 网站源码怎么预览怎么做自己的网站后台教程
  • 七星彩网投网站建设宿迁房产交易中心官网
  • 网站大气模板四川住房建设网站
  • 青岛seo整站优化招商电话安顺seo
  • 邢台手机网站建设信息梧州网站建设厂家
  • 所有网站排名2015年工布江达网站建设