热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ssm整合(基于xml配置方式)

本文是基于xml配置的方式来整合SpringMVC、Spring和Mybatis(基于注解的方式会再写一篇文章),步骤如下:

本文是基于xml配置的方式来整合SpringMVC、Spring和Mybatis(基于注解的方式会再写一篇文章),步骤如下:

(1)首先自然是依赖包的配置文件 pom.xml

<project xmlns&#61;"http://maven.apache.org/POM/4.0.0" xmlns:xsi&#61;"http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation&#61;"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><modelVersion>4.0.0modelVersion><groupId>com.xuebusigroupId><artifactId>xssmartifactId><packaging>warpackaging><version>1.0-SNAPSHOTversion><name>ssm Maven Webappname><url>http://maven.apache.orgurl><properties><generator.version>1.3.2generator.version><junit.version>4.12junit.version><spring.version>4.1.3.RELEASEspring.version><mybatis.version>3.2.8mybatis.version><mybatis.spring.version>1.2.2mybatis.spring.version><mybatis.paginator.version>1.2.15mybatis.paginator.version><mysql.version>5.1.32mysql.version><slf4j.version>1.6.4slf4j.version><jackson.version>2.4.2jackson.version><druid.version>1.0.9druid.version><httpclient.version>4.3.5httpclient.version><jstl.version>1.2jstl.version><servlet-api.version>2.5servlet-api.version><jsp-api.version>2.0jsp-api.version><joda-time.version>2.5joda-time.version><commons-lang3.version>3.3.2commons-lang3.version><commons-io.version>1.3.2commons-io.version><commons-net.version>3.3commons-net.version><pagehelper.version>3.4.2pagehelper.version><jsqlparser.version>0.9.1jsqlparser.version><commons-fileupload.version>1.3.1commons-fileupload.version><jedis.version>2.7.2jedis.version><solrj.version>4.10.3solrj.version>properties><dependencies><dependency><groupId>org.mybatis.generatorgroupId><artifactId>mybatis-generator-coreartifactId><version>${generator.version}version>dependency><dependency><groupId>joda-timegroupId><artifactId>joda-timeartifactId><version>${joda-time.version}version>dependency><dependency><groupId>org.apache.commonsgroupId><artifactId>commons-lang3artifactId><version>${commons-lang3.version}version>dependency><dependency><groupId>org.apache.commonsgroupId><artifactId>commons-ioartifactId><version>${commons-io.version}version>dependency><dependency><groupId>commons-netgroupId><artifactId>commons-netartifactId><version>${commons-net.version}version>dependency><dependency><groupId>com.fasterxml.jackson.coregroupId><artifactId>jackson-databindartifactId><version>${jackson.version}version>dependency><dependency><groupId>org.apache.httpcomponentsgroupId><artifactId>httpclientartifactId><version>${httpclient.version}version>dependency><dependency><groupId>org.slf4jgroupId><artifactId>slf4j-log4j12artifactId><version>${slf4j.version}version>dependency><dependency><groupId>org.mybatisgroupId><artifactId>mybatisartifactId><version>${mybatis.version}version>dependency><dependency><groupId>org.mybatisgroupId><artifactId>mybatis-springartifactId><version>${mybatis.spring.version}version>dependency><dependency><groupId>com.github.miemiedevgroupId><artifactId>mybatis-paginatorartifactId><version>${mybatis.paginator.version}version>dependency><dependency><groupId>com.github.pagehelpergroupId><artifactId>pagehelperartifactId><version>${pagehelper.version}version>dependency><dependency><groupId>mysqlgroupId><artifactId>mysql-connector-javaartifactId><version>${mysql.version}version>dependency><dependency><groupId>com.alibabagroupId><artifactId>druidartifactId><version>${druid.version}version>dependency><dependency><groupId>org.springframeworkgroupId><artifactId>spring-contextartifactId><version>${spring.version}version>dependency><dependency><groupId>org.springframeworkgroupId><artifactId>spring-beansartifactId><version>${spring.version}version>dependency><dependency><groupId>org.springframeworkgroupId><artifactId>spring-webmvcartifactId><version>${spring.version}version>dependency><dependency><groupId>org.springframeworkgroupId><artifactId>spring-jdbcartifactId><version>${spring.version}version>dependency><dependency><groupId>org.springframeworkgroupId><artifactId>spring-aspectsartifactId><version>${spring.version}version>dependency><dependency><groupId>jstlgroupId><artifactId>jstlartifactId><version>${jstl.version}version>dependency><dependency><groupId>javax.servletgroupId><artifactId>servlet-apiartifactId><version>${servlet-api.version}version><scope>providedscope>dependency><dependency><groupId>javax.servletgroupId><artifactId>jsp-apiartifactId><version>${jsp-api.version}version><scope>providedscope>dependency><dependency><groupId>commons-fileuploadgroupId><artifactId>commons-fileuploadartifactId><version>${commons-fileupload.version}version>dependency><dependency><groupId>redis.clientsgroupId><artifactId>jedisartifactId><version>${jedis.version}version>dependency><dependency><groupId>org.apache.solrgroupId><artifactId>solr-solrjartifactId><version>${solrj.version}version>dependency><dependency><groupId>junitgroupId><artifactId>junitartifactId><version>${junit.version}version><scope>testscope>dependency>dependencies><build><resources><resource><directory>src/main/javadirectory><includes><include>**/*.propertiesinclude><include>**/*.xmlinclude>includes><filtering>falsefiltering>resource>resources><plugins><plugin><groupId>org.apache.maven.pluginsgroupId><artifactId>maven-resources-pluginartifactId><version>2.7version><configuration><encoding>UTF-8encoding>configuration>plugin><plugin><groupId>org.apache.maven.pluginsgroupId><artifactId>maven-compiler-pluginartifactId><version>3.2version><configuration><source>1.7source><target>1.7target><encoding>UTF-8encoding>configuration>plugin>plugins><pluginManagement><plugins><plugin><groupId>org.apache.tomcat.mavengroupId><artifactId>tomcat7-maven-pluginartifactId><version>2.2version>plugin>plugins>pluginManagement>build>
project>

&#xff08;2&#xff09;既然是web项目&#xff0c;首先得配置web.xml

xml version&#61;"1.0" encoding&#61;"UTF-8"?>
<web-app xmlns:xsi&#61;"http://www.w3.org/2001/XMLSchema-instance"xmlns&#61;"http://java.sun.com/xml/ns/javaee"xsi:schemaLocation&#61;"http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id&#61;"xuebusi" version&#61;"2.5"><display-name>xuebusidisplay-name><welcome-file-list><welcome-file>index.htmlwelcome-file><welcome-file>index.htmwelcome-file><welcome-file>index.jspwelcome-file><welcome-file>default.htmlwelcome-file><welcome-file>default.htmwelcome-file><welcome-file>default.jspwelcome-file>welcome-file-list><context-param><param-name>contextConfigLocationparam-name><param-value>classpath:spring/applicationContext-*.xmlparam-value>context-param><listener><listener-class>org.springframework.web.context.ContextLoaderListenerlistener-class>listener><filter><filter-name>CharacterEncodingFilterfilter-name><filter-class>org.springframework.web.filter.CharacterEncodingFilterfilter-class><init-param><param-name>encodingparam-name><param-value>utf-8param-value>init-param>filter><filter-mapping><filter-name>CharacterEncodingFilterfilter-name><url-pattern>/*url-pattern>filter-mapping><servlet><servlet-name>dispatcherServletservlet-name><servlet-class>org.springframework.web.servlet.DispatcherServletservlet-class><init-param><param-name>contextConfigLocationparam-name><param-value>classpath:spring/springmvc.xmlparam-value>init-param><load-on-startup>1load-on-startup>servlet><servlet-mapping><servlet-name>dispatcherServletservlet-name><url-pattern>/url-pattern>servlet-mapping>
web-app>

 

&#xff08;3&#xff09;数据库连接配置 db.properties 

jdbc.driver&#61;com.mysql.jdbc.Driver
jdbc.url&#61;jdbc:mysql://localhost:3306/xssm?characterEncoding&#61;utf-8
jdbc.username&#61;root
jdbc.password&#61;root

 

&#xff08;4&#xff09;Mybatis的配置文件 SqlMapConfig.xml

xml version&#61;"1.0" encoding&#61;"UTF-8" ?>
DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration><plugins><plugin interceptor&#61;"com.github.pagehelper.PageHelper"><property name&#61;"dialect" value&#61;"mysql"/>plugin>plugins>
configuration>

&#xff08;5&#xff09;springmvc的配置文件 springmvc.xml

xml version&#61;"1.0" encoding&#61;"UTF-8"?>
<beans xmlns&#61;"http://www.springframework.org/schema/beans"xmlns:xsi&#61;"http://www.w3.org/2001/XMLSchema-instance"xmlns:context&#61;"http://www.springframework.org/schema/context"xmlns:mvc&#61;"http://www.springframework.org/schema/mvc"xsi:schemaLocation&#61;"http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc-4.0.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsd"><context:component-scan base-package&#61;"com.xuebusi.xssm.controller" /><mvc:annotation-driven /><beanclass&#61;"org.springframework.web.servlet.view.InternalResourceViewResolver"><property name&#61;"prefix" value&#61;"/WEB-INF/jsp/" /><property name&#61;"suffix" value&#61;".jsp" />bean><mvc:resources location&#61;"/WEB-INF/css/" mapping&#61;"/css/**"/><mvc:resources location&#61;"/WEB-INF/js/" mapping&#61;"/js/**"/><bean id&#61;"multipartResolver"class&#61;"org.springframework.web.multipart.commons.CommonsMultipartResolver"><property name&#61;"defaultEncoding" value&#61;"UTF-8">property><property name&#61;"maxUploadSize" value&#61;"5242880">property>bean>
beans>

&#xff08;6&#xff09;Spring的配置文件applicationContext-service.xml 扫描&#64;Service注解

xml version&#61;"1.0" encoding&#61;"UTF-8"?>
<beans xmlns&#61;"http://www.springframework.org/schema/beans"xmlns:context&#61;"http://www.springframework.org/schema/context"xmlns:xsi&#61;"http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation&#61;"http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-4.0.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-4.0.xsd"><context:component-scan base-package&#61;"com.xuebusi.xssm.service">context:component-scan>
beans>

&#xff08;7&#xff09;Spring的事物配置 applicationContext-trans.xml

xml version&#61;"1.0" encoding&#61;"UTF-8"?>
<beans xmlns&#61;"http://www.springframework.org/schema/beans"xmlns:aop&#61;"http://www.springframework.org/schema/aop"xmlns:tx&#61;"http://www.springframework.org/schema/tx"xmlns:xsi&#61;"http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation&#61;"http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-4.0.xsdhttp://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-4.0.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-4.0.xsd"><bean id&#61;"transactionManager" class&#61;"org.springframework.jdbc.datasource.DataSourceTransactionManager"><property name&#61;"dataSource" ref&#61;"dataSource"/>bean><tx:advice id&#61;"txAdvice" transaction-manager&#61;"transactionManager"><tx:attributes><tx:method name&#61;"save*" propagation&#61;"REQUIRED"/><tx:method name&#61;"insert*" propagation&#61;"REQUIRED"/><tx:method name&#61;"add*" propagation&#61;"REQUIRED"/><tx:method name&#61;"create*" propagation&#61;"REQUIRED"/><tx:method name&#61;"delete*" propagation&#61;"REQUIRED"/><tx:method name&#61;"update*" propagation&#61;"REQUIRED"/><tx:method name&#61;"find*" propagation&#61;"SUPPORTS" read-only&#61;"true"/><tx:method name&#61;"select*" propagation&#61;"SUPPORTS" read-only&#61;"true"/><tx:method name&#61;"get*" propagation&#61;"SUPPORTS" read-only&#61;"true"/>tx:attributes>tx:advice><aop:config><aop:advisor advice-ref&#61;"txAdvice" pointcut&#61;"execution(* com.xuebusi.xssm.service.*.*(..))"/>aop:config>
beans>

&#xff08;8&#xff09;Spring的数据源配置文件 applicationContext-dao.xml

xml version&#61;"1.0" encoding&#61;"UTF-8"?>
<beans xmlns&#61;"http://www.springframework.org/schema/beans"xmlns:context&#61;"http://www.springframework.org/schema/context"xmlns:xsi&#61;"http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation&#61;"http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-4.0.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-4.0.xsd"><context:property-placeholder location&#61;"classpath:resource/*.properties" /><bean id&#61;"dataSource" class&#61;"com.alibaba.druid.pool.DruidDataSource" destroy-method&#61;"close"><property name&#61;"url" value&#61;"${jdbc.url}" /><property name&#61;"username" value&#61;"${jdbc.username}" /><property name&#61;"password" value&#61;"${jdbc.password}" /><property name&#61;"driverClassName" value&#61;"${jdbc.driver}" /><property name&#61;"maxActive" value&#61;"10" /><property name&#61;"minIdle" value&#61;"5" />bean><bean id&#61;"sqlSessionFactory" class&#61;"org.mybatis.spring.SqlSessionFactoryBean"><property name&#61;"configLocation" value&#61;"classpath:mybatis/SqlMapConfig.xml">property><property name&#61;"dataSource" ref&#61;"dataSource">property>bean><bean class&#61;"org.mybatis.spring.mapper.MapperScannerConfigurer"><property name&#61;"basePackage" value&#61;"com.xuebusi.xssm.mapper">property>bean>
beans>

&#xff08;9&#xff09;redis配置文件 applicationContext-jedis.xml

xml version&#61;"1.0" encoding&#61;"UTF-8"?>
<beans xmlns&#61;"http://www.springframework.org/schema/beans"xmlns:xsi&#61;"http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation&#61;"http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-4.0.xsd"><bean id&#61;"jedisPoolConfig" class&#61;"redis.clients.jedis.JedisPoolConfig"><property name&#61;"maxTotal" value&#61;"30" /><property name&#61;"maxIdle" value&#61;"10" /><property name&#61;"numTestsPerEvictionRun" value&#61;"1024" /><property name&#61;"timeBetweenEvictionRunsMillis" value&#61;"30000" /><property name&#61;"minEvictableIdleTimeMillis" value&#61;"1800000" /><property name&#61;"softMinEvictableIdleTimeMillis" value&#61;"10000" /><property name&#61;"maxWaitMillis" value&#61;"1500" /><property name&#61;"testOnBorrow" value&#61;"true" /><property name&#61;"testWhileIdle" value&#61;"true" /><property name&#61;"blockWhenExhausted" value&#61;"false" />bean> <bean id&#61;"redisClient" class&#61;"redis.clients.jedis.JedisCluster"><constructor-arg name&#61;"nodes"><set><bean class&#61;"redis.clients.jedis.HostAndPort"><constructor-arg name&#61;"host" value&#61;"192.168.71.13">constructor-arg><constructor-arg name&#61;"port" value&#61;"7001">constructor-arg>bean><bean class&#61;"redis.clients.jedis.HostAndPort"><constructor-arg name&#61;"host" value&#61;"192.168.71.13">constructor-arg><constructor-arg name&#61;"port" value&#61;"7002">constructor-arg>bean><bean class&#61;"redis.clients.jedis.HostAndPort"><constructor-arg name&#61;"host" value&#61;"192.168.71.13">constructor-arg><constructor-arg name&#61;"port" value&#61;"7003">constructor-arg>bean><bean class&#61;"redis.clients.jedis.HostAndPort"><constructor-arg name&#61;"host" value&#61;"192.168.71.13">constructor-arg><constructor-arg name&#61;"port" value&#61;"7004">constructor-arg>bean><bean class&#61;"redis.clients.jedis.HostAndPort"><constructor-arg name&#61;"host" value&#61;"192.168.71.13">constructor-arg><constructor-arg name&#61;"port" value&#61;"7005">constructor-arg>bean><bean class&#61;"redis.clients.jedis.HostAndPort"><constructor-arg name&#61;"host" value&#61;"192.168.71.13">constructor-arg><constructor-arg name&#61;"port" value&#61;"7006">constructor-arg>bean>set>constructor-arg><constructor-arg name&#61;"poolConfig" ref&#61;"jedisPoolConfig">constructor-arg>bean><bean id&#61;"jedisClientCluster" class&#61;"com.xuebusi.xssm.dao.impl.JedisClientCluster">bean>beans>

 

&#xff08;10&#xff09;在MySQL中创建一张x_user表

CREATE TABLE &#96;x_user&#96; (&#96;id&#96; int(11) NOT NULL AUTO_INCREMENT,&#96;name&#96; varchar(255) DEFAULT NULL,&#96;address&#96; varchar(255) DEFAULT NULL,&#96;age&#96; int(11) DEFAULT NULL,&#96;phone&#96; varchar(255) DEFAULT NULL,PRIMARY KEY (&#96;id&#96;)
) ENGINE
&#61;InnoDB AUTO_INCREMENT&#61;4 DEFAULT CHARSET&#61;utf8;

往表里插入几条测试数据&#xff1a;

 

&#xff08;11&#xff09;通过mybatis的逆向工程生成x_user表对应的实体类、接口类、Example类以及Mapper.xml配置文件&#xff0c;具体方法移步另一篇文章《mybatis逆向工程自动生成实体类、接口以及映射Mapper.xml配置文件》&#xff0c;地址&#xff1a;http://www.cnblogs.com/jun1019/p/8073229.html

 

&#xff08;12&#xff09;编写Controller类测试下

package com.xuebusi.xssm.controller;import com.xuebusi.xssm.pojo.XUser;
import com.xuebusi.xssm.service.XUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;import java.util.List;/*** Created by SYJ on 2017/12/18.*/
&#64;Controller
&#64;RequestMapping(value
&#61; "/user")
public class XUserController {&#64;Autowiredprivate XUserService userService;/*** 根据id查询用户* &#64;param id* &#64;return*/&#64;RequestMapping(value &#61; "/{id}")&#64;ResponseBodypublic XUser get(&#64;PathVariable("id") Integer id) {return userService.selectByPrimaryKey(id);}/*** 查询所有用户* &#64;return*/&#64;RequestMapping(value &#61; "/list")&#64;ResponseBodypublic List list() {return userService.findAll();}/*** 添加用户* &#64;return*/&#64;RequestMapping(value &#61; "/add")&#64;ResponseBodypublic int insert() {XUser user &#61; new XUser();user.setName("王五");user.setAge(25);user.setPhone("13910108899");user.setAddress("重庆");return userService.insert(user);}}

&#xff08;13&#xff09; 编写Service接口&#xff1a;

package com.xuebusi.xssm.service;import com.xuebusi.xssm.pojo.XUser;import java.util.List;/*** Created by SYJ on 2017/12/18.*/
public interface XUserService {XUser selectByPrimaryKey(Integer id);int insert(XUser user);List findAll();
}

&#xff08;14&#xff09;编写Service实现类&#xff1a;

package com.xuebusi.xssm.service.impl;import com.xuebusi.xssm.mapper.XUserMapper;
import com.xuebusi.xssm.pojo.XUser;
import com.xuebusi.xssm.service.XUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import java.util.List;/*** Created by SYJ on 2017/12/18.*/
&#64;Service
public class XUserServiceImpl implements XUserService {&#64;Autowiredprivate XUserMapper userMapper;/*** 根据id查询用户* &#64;param id* &#64;return*/&#64;Overridepublic XUser selectByPrimaryKey(Integer id) {XUser user &#61; userMapper.selectByPrimaryKey(id);return user;}/*** 添加用户* &#64;param user* &#64;return*/&#64;Overridepublic int insert(XUser user) {return userMapper.insert(user);}/*** 查询所有用户* &#64;return*/&#64;Overridepublic List findAll() {return userMapper.selectByExample(null);}
}

&#xff08;15&#xff09;启动项目&#xff0c;通过浏览器访问下&#xff1a;

 

本文源码&#xff1a; https://github.com/xuebus/xssm

 



推荐阅读
  • 在JavaWeb开发中,文件上传是一个常见的需求。无论是通过表单还是其他方式上传文件,都必须使用POST请求。前端部分通常采用HTML表单来实现文件选择和提交功能。后端则利用Apache Commons FileUpload库来处理上传的文件,该库提供了强大的文件解析和存储能力,能够高效地处理各种文件类型。此外,为了提高系统的安全性和稳定性,还需要对上传文件的大小、格式等进行严格的校验和限制。 ... [详细]
  • 通过Apache Commons FileUpload组件,可以根据具体应用需求实现多样化的文件上传功能。在基本应用场景中,开发者可以通过调用单一方法来解析Servlet请求,从而轻松处理文件上传任务。此外,该组件还提供了丰富的配置选项和高级功能,支持大文件上传、多文件并发处理等复杂场景,显著提升了文件上传的效率和可靠性。 ... [详细]
  • Spring Boot 中配置全局文件上传路径并实现文件上传功能
    本文介绍如何在 Spring Boot 项目中配置全局文件上传路径,并通过读取配置项实现文件上传功能。通过这种方式,可以更好地管理和维护文件路径。 ... [详细]
  • 秒建一个后台管理系统?用这5个开源免费的Java项目就够了
    秒建一个后台管理系统?用这5个开源免费的Java项目就够了 ... [详细]
  • 深入解析Gradle中的Project核心组件
    在Gradle构建系统中,`Project` 是一个核心组件,扮演着至关重要的角色。通过使用 `./gradlew projects` 命令,可以清晰地列出当前项目结构中包含的所有子项目,这有助于开发者更好地理解和管理复杂的多模块项目。此外,`Project` 对象还提供了丰富的配置选项和生命周期管理功能,使得构建过程更加灵活高效。 ... [详细]
  • RancherOS 是由 Rancher Labs 开发的一款专为 Docker 设计的轻量级 Linux 发行版,提供了一个全面的 Docker 运行环境。其引导镜像仅 20MB,非常适合在资源受限的环境中部署。本文将详细介绍如何在 ESXi 虚拟化平台上安装和配置 RancherOS,帮助用户快速搭建高效、稳定的容器化应用环境。 ... [详细]
  • 在处理大文件上传时,服务端为何无法直接接收?这主要与 PHP 配置文件 `php.ini` 中的几个关键参数有关,如 `upload_max_filesize` 和 `post_max_size`。这些参数分别限制了单个文件的最大上传大小和整个 POST 请求的数据量。为了实现大文件的高效上传,可以通过文件分割与分片上传的方法来解决。本文将详细介绍这一实现方法,并提供相应的代码示例,帮助开发者更好地理解和应用这一技术。 ... [详细]
  • 三周学会小程序第七讲:提交问题
    截止到上一讲可以支持数据库存储了,所以这一讲开始讲解怎么从小程序发布一个问题并存储到服务器端。下面简单罗列一下本讲的知识点。对了老规矩,文末附源码。对小 ... [详细]
  • 开始实现之前先上个效果图tips网络图片需先配置download域名,可通过wx.getImageInfo转为临时路径;个人习惯问题,我习 ... [详细]
  • 腾讯云前台面经(笔试+3技术面+HR面)
    话不多说,直接上题。(时间周期太长,可能不太全了)面试周期:从投递简历到收到offer大概经历了一个月左右,所以最好还是不要裸辞,不然心态会裂开。笔试题:(二面、三面后的笔试)1、 ... [详细]
  • 【实例简介】本文详细介绍了如何在PHP中实现微信支付的退款功能,并提供了订单创建类的完整代码及调用示例。在配置过程中,需确保正确设置相关参数,特别是证书路径应根据项目实际情况进行调整。为了保证系统的安全性,存放证书的目录需要设置为可读权限。值得注意的是,普通支付操作无需证书,但在执行退款操作时必须提供证书。此外,本文还对常见的错误处理和调试技巧进行了说明,帮助开发者快速定位和解决问题。 ... [详细]
  • 基于Net Core 3.0与Web API的前后端分离开发:Vue.js在前端的应用
    本文介绍了如何使用Net Core 3.0和Web API进行前后端分离开发,并重点探讨了Vue.js在前端的应用。后端采用MySQL数据库和EF Core框架进行数据操作,开发环境为Windows 10和Visual Studio 2019,MySQL服务器版本为8.0.16。文章详细描述了API项目的创建过程、启动步骤以及必要的插件安装,为开发者提供了一套完整的开发指南。 ... [详细]
  • 本项目在Java Maven框架下,利用POI库实现了Excel数据的高效导入与导出功能。通过优化数据处理流程,提升了数据操作的性能和稳定性。项目已发布至GitHub,当前最新版本为0.0.5。该项目不仅适用于小型应用,也可扩展用于大型企业级系统,提供了灵活的数据管理解决方案。GitHub地址:https://github.com/83945105/holygrail,Maven坐标:`com.github.83945105:holygrail:0.0.5`。 ... [详细]
  • JVM参数设置与命令行工具详解
    JVM参数配置与命令行工具的深入解析旨在优化系统性能,通过合理设置JVM参数,确保在高吞吐量的前提下,有效减少垃圾回收(GC)的频率,进而降低系统停顿时间,提升服务的稳定性和响应速度。此外,本文还将详细介绍常用的JVM命令行工具,帮助开发者更好地监控和调优JVM运行状态。 ... [详细]
  • 深入解析Java内存架构、垃圾回收机制与内存泄漏问题
    Java内存架构(Java内存模型)上面是堆的Java内存模型以及Java虚拟机(JVM)中运行的任何Java应用程序的Pe ... [详细]
author-avatar
qs08y602lt
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有