JAVA 第8页
Spring Boot中@MapperScan注解多个包-Ddmit

Spring Boot中@MapperScan注解多个包

单个: @SpringBootApplication @MapperScan('org.4spaces.**.dao') public class Application { public static void main(String[] args) { // ... } } 多个: @SpringBootApplication @Mapper...
ddmit的头像-DdmitDdmit5年前
024390
Java中String.format方法使用介绍-Ddmit

Java中String.format方法使用介绍

在Java中,String.format方法可以对数字、字符串和时间(日期)数据进行格式转换,本文整理了Java中String.format方法的一般使用示例: 1.字符串格式语法 1.1 常规、字符和数字类型的格式语法 %[a...
ddmit的头像-DdmitDdmit5年前
024330
Java中的Snmp编程:snmp4j的使用-Ddmit

Java中的Snmp编程:snmp4j的使用

网管系统基本上都是通过snmp协议来对网络设备进行管理,在Java中,提供了snmp4j.jar这个工具包,来帮助我们方便的实现对网络设备的管理工作,理论上,支持snmp协议的设备,都可以对其状态进行监...
ddmit的头像-DdmitDdmit5年前
024320
SpringBoot Controller接收参数的几种方式盘点-Ddmit

SpringBoot Controller接收参数的几种方式盘点

SpringBoot Controller接收参数的几种常用方式盘点如下: 一、请求路径参数 1.@PathVariable 适用于url包含请求参数的情况,例如:/common-bsp/bsp/organ/{struIds},后台接收示例: @DeleteMap...
ddmit的头像-DdmitDdmit6年前
024230
IntelliJ IDEA创建Java web Maven项目图文教程-Ddmit

IntelliJ IDEA创建Java web Maven项目图文教程

环境: IntelliJ IDEA ULTIMATE 2018.1 ; 使用IntelliJ IDEA创建Java web Maven项目的具体步骤如下: 新建WEB工程框架 等待idea后台下载完依赖之后,这样我们就新建了一个名称叫agreport的java...
ddmit的头像-DdmitDdmit6年前
024230
Java监听器的简单使用-Ddmit

Java监听器的简单使用

监听器在Java开发过程中发挥着重要作用,我们经常需要在系统刚一启动就要执行某些任务或进行某些操作,还有在统计当前在线用户数目时也需要使用监听器,因此有必要了解一下Java中监听器的使用过...
ddmit的头像-DdmitDdmit6年前
024220
解决web.xml报错The content of element type “web-app” must match(正解)-Ddmit

解决web.xml报错The content of element type “web-app” must match(正解)

IntelliJ IDEA编辑器显示web.xml红叉,内容如下 The content of element type “web-app” must match “(icon ,display- name ,description ,distributable ,context-param*,filter*,filter-ma...
ddmit的头像-DdmitDdmit6年前
024040
Spring判断当前连接的数据库类型-Ddmit

Spring判断当前连接的数据库类型

Java代码获取当前连接的数据库类型,这里使用org.springframework.jdbc.core.JdbcTemplate类。 依赖: <dependency> <groupId>org.springframework.boot</groupId> <artif...
ddmit的头像-DdmitDdmit5年前
023980
WARNING: Unknown version string [3.1]. Default version will be used.-Ddmit

WARNING: Unknown version string [3.1]. Default version will be used.

Tomcat 7只支持 Servlet 3.0及以下版本,Tomcat 8支持 Servlet 3.1。修改web.xml。 参考: https://stackoverflow.com/questions/24226131/warning-unknown-version-string-3-1-default-version...
ddmit的头像-DdmitDdmit6年前
023800
Java中InputStream转换为byte数组-Ddmit

Java中InputStream转换为byte数组

可以使用Apache Commons IO进行解决: InputStream is; byte[] bytes = IOUtils.toByteArray(is); 参考:Convert InputStream to byte array in Java;
ddmit的头像-DdmitDdmit6年前
023760