JAVA演示阿里云图像识别API,印刷文字识别-营业执照识别

 更新时间:2019年05月03日 15:14:26   投稿:WDC  
最近有由于工作需要,开始接触阿里云的云市场的印刷文字识别API-营业执照识别这里我加上了官网的申请说明,只要你有阿里云账号就可以用,前500次是免费的,API说明很简陋,只能做个简单参考
(福利推荐:【腾讯云】服务器最新限时优惠活动,云服务器1核2G仅99元/年、2核4G仅768元/3年,立即抢购>>>:9i0i.cn/qcloud

(福利推荐:你还在原价购买阿里云服务器?现在阿里云0.8折限时抢购活动来啦!4核8G企业云服务器仅2998元/3年,立即抢购>>>:9i0i.cn/aliyun

最近有由于需要,我开始接触阿里云的云市场的印刷文字识别-营业执照识别这里我加上了官网的申请说明,只要你有阿里云账号就可以用,前500次是免费的,API说明很简陋,只能做个简单参考。

一、API介绍

JAVA示例: 

public static void main(String[] args) {
   String host = "https://dm-58.data.aliyun.com";
   String path = "/rest/160601/ocr/ocr_business_license.json";
   String method = "POST";
   String appcode = "你自己的AppCode";
   Map<String, String> headers = new HashMap<String, String>();
   //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
   headers.put("Authorization", "APPCODE " + appcode);
   //根据API的要求,定义相对应的Content-Type
   headers.put("Content-Type", "application/json; charset=UTF-8");
   Map<String, String> querys = new HashMap<String, String>();
   String bodys = "{\"image\":\"对图片内容进行Base64编码\"}";


   try {
   /**
   * 重要提示如下:
   * HttpUtils请从
   * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
   * 下载
   *
   * 相应的依赖请参照
   * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
   */
   HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
   System.out.println(response.toString());
   //获取response的body
   //System.out.println(EntityUtils.toString(response.getEntity()));
   } catch (Exception e) {
   e.printStackTrace();
   }
 }

返回码:

{
  "config_str" : "null\n", #配置字符串信息
  "angle" : float, #输入图片的角度(顺时针旋转),[0, 90, 180,270]
  "reg_num" : string, #注册号,没有识别出来时返回"FailInRecognition"
  "name" : string, #公司名称,没有识别出来时返回"FailInRecognition"
  "type" : string, #公司类型,没有识别出来时返回"FailInRecognition"
  "person" : string, #公司法人,没有识别出来时返回"FailInRecognition"
  "establish_date": string, #公司注册日期(例:证件上为"2014年04月16日",算法返回"20140416")
  "valid_period": string, #公司营业期限终止日期(例:证件上为"2014年04月16日至2034年04月15日",算法返回"20340415")
  #当前算法将日期格式统一为输出为"年月日"(如"20391130"),并将"长期"表示为"29991231",若证件上没有营业期限,则默认其为"长期",返回"29991231"。
  "address" : string, #公司地址,没有识别出来时返回"FailInRecognition"
  "capital" : string, #注册资本,没有识别出来时返回"FailInRecognition"
  "business": string, #经营范围,没有识别出来时返回"FailInRecognition"
  "emblem" : string, #国徽位置[top,left,height,width],没有识别出来时返回"FailInDetection"
  "title" : string, #标题位置[top,left,height,width],没有识别出来时返回"FailInDetection"
  "stamp" : string, #印章位置[top,left,height,width],没有识别出来时返回"FailInDetection"
  "qrcode" : string, #二维码位置[top,left,height,width],没有识别出来时返回"FailInDetection"
  "success" : bool, #识别成功与否 true/false
  "request_id": string
}

购买后,在云市场列表里展示,你可要点击进去查看AppCode等其主要信息(接口调用里需要AppCode)

简单的API介绍,但挺有效了的,唯一不好的就是没有错误返回码的描述,需要自己测试。

二、代码开发

闲话少说,上代码:

AliyunImageRecognitionUtil :阿里云图像识别工具类

package com.casic.cloud.qcy.util;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;

import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import com.alibaba.fastjson.JSONObject;
import com.casic.cloud.qcy.constant.Constants;

import sun.misc.BASE64Encoder;

/** 
 * @ClassName: AliyunImageRecognitionUtil 
 * @Description: 阿里云图像识别工具类
 * @author: tianpengw
 * @date 2019年3月21日 上午8:49:08 
 * 
 */
public class AliyunImageRecognitionUtil {

 private static String businessLicenceHost = PropertiesUtil.getProperties("businessLicenceHost");
 
 private static String businessLicencePath = PropertiesUtil.getProperties("businessLicencePath");
 
 private static String method = "POST";
 
 private static String appCode = PropertiesUtil.getProperties("appCode");
 

 /**
 * 
 * @Description: 根据文件全路径识别
 * @author: tianpengw
 * @param imgPath
 * @return
 */
 public static Map<String,Object> bussinessLicenceRecognition(String imgPath){
 Map<String,Object> resultMap = new HashMap<String,Object>();
 
 Map<String, String> headers = new HashMap<String, String>();
 //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
   headers.put("Authorization", "APPCODE " + appCode);
   headers.put("Content-Type", "application/json; charset=UTF-8");
   
   Map<String, String> querys = new HashMap<String, String>();
   String bodys = "{\"image\":\""+imageToBase64Str(imgPath)+"\"}";
   try {
   /**
   * 重要提示如下:
   * HttpUtils请从
   * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
   * 下载
   *
   * 相应的依赖请参照
   * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
   */
   HttpResponse response = AliyunHttpUtils.doPost(businessLicenceHost, businessLicencePath, method, headers, querys, bodys);
   String resStr = EntityUtils.toString(response.getEntity());
   System.out.println(resStr);
   
   resultMap = JSONObject.parseObject(resStr, Map.class);
   //获取response的body
   } catch (Exception e) {
   e.printStackTrace();
   }
   return resultMap;
 }
 
 /**
 * 
 * @Description: 根据InputStream识别
 * @author: tianpengw
 * @param imgPath
 * @return
 */
 public static Map<String,Object> bussinessLicenceRecognition(InputStream inputStream){
 Map<String,Object> resultMap = new HashMap<String,Object>();
 
 Map<String, String> headers = new HashMap<String, String>();
 //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
   headers.put("Authorization", "APPCODE " + appCode);
   headers.put("Content-Type", "application/json; charset=UTF-8");
   
   Map<String, String> querys = new HashMap<String, String>();
   // 加密
   BASE64Encoder encoder = new BASE64Encoder();
   byte[] data = null;
   try {
    data = new byte[inputStream.available()];
    inputStream.read(data);
    inputStream.close();
   } catch (IOException e) {
    e.printStackTrace();
   }
   String bodys = "{\"image\":\""+encoder.encode(data)+"\"}";
   try {
   /**
   * 重要提示如下:
   * HttpUtils请从
   * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
   * 下载
   *
   * 相应的依赖请参照
   * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
   */
   HttpResponse response = AliyunHttpUtils.doPost(businessLicenceHost, businessLicencePath, method, headers, querys, bodys);
   String resStr = EntityUtils.toString(response.getEntity());
   System.out.println(resStr);
   
   resultMap = JSONObject.parseObject(resStr, Map.class);
   resultMap.put("errCode", Constants.RESULT_SUCCESS);
   //获取response的body
   } catch (Exception e) {
   e.printStackTrace();
   resultMap.put("errCode", Constants.RESULT_FAIL);
   }
   return resultMap;
 }

 /**
 * 
 * @Description: 根据byte[]识别
 * @author: tianpengw
 * @param imgPath
 * @return
 */
 public static Map<String,Object> bussinessLicenceRecognition( byte[] data){
 Map<String,Object> resultMap = new HashMap<String,Object>();
 
 Map<String, String> headers = new HashMap<String, String>();
 //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
   headers.put("Authorization", "APPCODE " + appCode);
   headers.put("Content-Type", "application/json; charset=UTF-8");
   
   Map<String, String> querys = new HashMap<String, String>();
   // 加密
   BASE64Encoder encoder = new BASE64Encoder();
   
   String bodys = "{\"image\":\""+encoder.encode(data)+"\"}";
   try {
   /**
   * 重要提示如下:
   * HttpUtils请从
   * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
   * 下载
   *
   * 相应的依赖请参照
   * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
   */
   HttpResponse response = AliyunHttpUtils.doPost(businessLicenceHost, businessLicencePath, method, headers, querys, bodys);
   String resStr = EntityUtils.toString(response.getEntity());
   System.out.println(resStr);
   
   resultMap = JSONObject.parseObject(resStr, Map.class);
   resultMap.put("errCode", Constants.RESULT_SUCCESS);
   //获取response的body
   } catch (Exception e) {
   e.printStackTrace();
   resultMap.put("errCode", Constants.RESULT_FAIL);
   }
   return resultMap;
 }

 
 /**
  * 图片转base64字符串
  * @param imgFile 图片路径
  * @return
  */
  public static String imageToBase64Str(String imgFile) {
   InputStream inputStream = null;
   byte[] data = null;
   try {
    inputStream = new FileInputStream(imgFile);
    data = new byte[inputStream.available()];
    inputStream.read(data);
    inputStream.close();
   } catch (IOException e) {
    e.printStackTrace();
   }
   // 加密
   BASE64Encoder encoder = new BASE64Encoder();
   return encoder.encode(data);
  }
  
  public static void main(String[] args) {
 String imgPath = "d:/yyzznew1.jpg";
 Map<String,Object> map = AliyunImageRecognitionUtil.bussinessLicenceRecognition(imgPath);
 System.out.println(map.get("person"));
 System.out.println(map.get("reg_num"));
 }
}

AliyunHttpUtils :阿里云httpUtils

package com.casic.cloud.qcy.util;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;

/** 
 * @ClassName: AliyunHttpUtils 
 * @Description: 
 * @author: tianpengw
 * @date 2019年3月21日 上午8:44:51 
 * 
 */
public class AliyunHttpUtils {

 /**
 * get
 * 
 * @param host
 * @param path
 * @param method
 * @param headers
 * @param querys
 * @return
 * @throws Exception
 */
 public static HttpResponse doGet(String host, String path, String method, 
  Map<String, String> headers, 
  Map<String, String> querys)
      throws Exception {   
   HttpClient httpClient = wrapClient(host);

   HttpGet request = new HttpGet(buildUrl(host, path, querys));
    for (Map.Entry<String, String> e : headers.entrySet()) {
     request.addHeader(e.getKey(), e.getValue());
    }
    
    return httpClient.execute(request);
  }
 
 /**
 * post form
 * 
 * @param host
 * @param path
 * @param method
 * @param headers
 * @param querys
 * @param bodys
 * @return
 * @throws Exception
 */
 public static HttpResponse doPost(String host, String path, String method, 
  Map<String, String> headers, 
  Map<String, String> querys, 
  Map<String, String> bodys)
      throws Exception {   
   HttpClient httpClient = wrapClient(host);

   HttpPost request = new HttpPost(buildUrl(host, path, querys));
    for (Map.Entry<String, String> e : headers.entrySet()) {
     request.addHeader(e.getKey(), e.getValue());
    }

    if (bodys != null) {
      List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();

      for (String key : bodys.keySet()) {
        nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key)));
      }
      UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8");
      formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8");
      request.setEntity(formEntity);
    }

    return httpClient.execute(request);
  } 
 
 /**
 * Post String
 * 
 * @param host
 * @param path
 * @param method
 * @param headers
 * @param querys
 * @param body
 * @return
 * @throws Exception
 */
 public static HttpResponse doPost(String host, String path, String method, 
  Map<String, String> headers, 
  Map<String, String> querys, 
  String body)
      throws Exception {   
   HttpClient httpClient = wrapClient(host);

   HttpPost request = new HttpPost(buildUrl(host, path, querys));
    for (Map.Entry<String, String> e : headers.entrySet()) {
     request.addHeader(e.getKey(), e.getValue());
    }

    if (StringUtils.isNotBlank(body)) {
     request.setEntity(new StringEntity(body, "utf-8"));
    }

    return httpClient.execute(request);
  }
 
 /**
 * Post stream
 * 
 * @param host
 * @param path
 * @param method
 * @param headers
 * @param querys
 * @param body
 * @return
 * @throws Exception
 */
 public static HttpResponse doPost(String host, String path, String method, 
  Map<String, String> headers, 
  Map<String, String> querys, 
  byte[] body)
      throws Exception {   
   HttpClient httpClient = wrapClient(host);

   HttpPost request = new HttpPost(buildUrl(host, path, querys));
    for (Map.Entry<String, String> e : headers.entrySet()) {
     request.addHeader(e.getKey(), e.getValue());
    }

    if (body != null) {
     request.setEntity(new ByteArrayEntity(body));
    }

    return httpClient.execute(request);
  }
 
 /**
 * Put String
 * @param host
 * @param path
 * @param method
 * @param headers
 * @param querys
 * @param body
 * @return
 * @throws Exception
 */
 public static HttpResponse doPut(String host, String path, String method, 
  Map<String, String> headers, 
  Map<String, String> querys, 
  String body)
      throws Exception {   
   HttpClient httpClient = wrapClient(host);

   HttpPut request = new HttpPut(buildUrl(host, path, querys));
    for (Map.Entry<String, String> e : headers.entrySet()) {
     request.addHeader(e.getKey(), e.getValue());
    }

    if (StringUtils.isNotBlank(body)) {
     request.setEntity(new StringEntity(body, "utf-8"));
    }

    return httpClient.execute(request);
  }
 
 /**
 * Put stream
 * @param host
 * @param path
 * @param method
 * @param headers
 * @param querys
 * @param body
 * @return
 * @throws Exception
 */
 public static HttpResponse doPut(String host, String path, String method, 
  Map<String, String> headers, 
  Map<String, String> querys, 
  byte[] body)
      throws Exception {   
   HttpClient httpClient = wrapClient(host);

   HttpPut request = new HttpPut(buildUrl(host, path, querys));
    for (Map.Entry<String, String> e : headers.entrySet()) {
     request.addHeader(e.getKey(), e.getValue());
    }

    if (body != null) {
     request.setEntity(new ByteArrayEntity(body));
    }

    return httpClient.execute(request);
  }
 
 /**
 * Delete
 * 
 * @param host
 * @param path
 * @param method
 * @param headers
 * @param querys
 * @return
 * @throws Exception
 */
 public static HttpResponse doDelete(String host, String path, String method, 
  Map<String, String> headers, 
  Map<String, String> querys)
      throws Exception {   
   HttpClient httpClient = wrapClient(host);

   HttpDelete request = new HttpDelete(buildUrl(host, path, querys));
    for (Map.Entry<String, String> e : headers.entrySet()) {
     request.addHeader(e.getKey(), e.getValue());
    }
    
    return httpClient.execute(request);
  }
 
 private static String buildUrl(String host, String path, Map<String, String> querys) throws UnsupportedEncodingException {
   StringBuilder sbUrl = new StringBuilder();
   sbUrl.append(host);
   if (!StringUtils.isBlank(path)) {
   sbUrl.append(path);
    }
   if (null != querys) {
   StringBuilder sbQuery = new StringBuilder();
     for (Map.Entry<String, String> query : querys.entrySet()) {
     if (0 < sbQuery.length()) {
      sbQuery.append("&");
     }
     if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) {
      sbQuery.append(query.getValue());
        }
     if (!StringUtils.isBlank(query.getKey())) {
      sbQuery.append(query.getKey());
      if (!StringUtils.isBlank(query.getValue())) {
      sbQuery.append("=");
      sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8"));
      }      
        }
     }
     if (0 < sbQuery.length()) {
     sbUrl.append("?").append(sbQuery);
     }
    }
   
   return sbUrl.toString();
  }
 
 private static HttpClient wrapClient(String host) {
 HttpClient httpClient = new DefaultHttpClient();
 if (host.startsWith("https://")) {
  sslClient(httpClient);
 }
 
 return httpClient;
 }
 
 private static void sslClient(HttpClient httpClient) {
    try {
      SSLContext ctx = SSLContext.getInstance("TLS");
      X509TrustManager tm = new X509TrustManager() {
        public X509Certificate[] getAcceptedIssuers() {
          return null;
        }
        public void checkClientTrusted(X509Certificate[] xcs, String str) {
         
        }
        public void checkServerTrusted(X509Certificate[] xcs, String str) {
         
        }
      };
      ctx.init(null, new TrustManager[] { tm }, null);
      SSLSocketFactory ssf = new SSLSocketFactory(ctx);
      ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
      ClientConnectionManager ccm = httpClient.getConnectionManager();
      SchemeRegistry registry = ccm.getSchemeRegistry();
      registry.register(new Scheme("https", 443, ssf));
    } catch (KeyManagementException ex) {
      throw new RuntimeException(ex);
    } catch (NoSuchAlgorithmException ex) {
     throw new RuntimeException(ex);
    }
  }
}

PropertiesUtil :读取配置文件工具

package com.casic.cloud.qcy.util;

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

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/** 
 * @ClassName: PropertiesUtil 
 * @Description: 
 * @author tianpengw
 * @date 2018年6月27日 下午3:09:08 
 * 
 */
public class PropertiesUtil {

 private static Logger log = LogManager.getLogger(PropertiesUtil.class);
 
 private static Properties prop;
 
 static{
 try{
  if(null == prop){
  prop = new Properties();
  }
  InputStream fis = null;
  fis = ClassLoaderUtils.getResourceAsStream("common.properties", PropertiesUtil.class);
  if(fis!=null){
  prop.load(fis);// 将属性文件流装载到Properties对象中  
  fis.close();// 关闭流  
  }
 }catch (Exception e) {
  log.error("读取配置文件出错:" + e );
 }
 }
 
 /**
 * 
 * @Description: 根据key获取配置的值
 * @author tianpengw 
 * @param key
 * @return
 */
 public static String getProperties(String key){
 if(key==null) return null;
 return prop.getProperty(key);
 
 }
 
 
 /**
 * 
 * @Description: 
 * @author tianpengw 
 * @param proper 读取配置的文件名称
 * @param key
 * @return
 */
 public static String getPropertie(String resourceName,String key){
 InputStream fis = ClassLoaderUtils.getResourceAsStream(resourceName, PropertiesUtil.class);
 if(fis!=null){
  try {
  prop.load(fis);
  fis.close();// 关闭流  
  } catch (IOException e) {
  e.printStackTrace();
  }  
  
 }
 if(key==null) return null;
 return prop.getProperty(key);
 }
 
 
 /**
 * 
 * @Description: 根据key获取配置的值,若没有,则取传过来的默认的值
 * @author tianpengw 
 * @param key
 * @param defaultValue 默认值
 * @return
 */
 public static String getProperties(String key,String defaultValue){
 if(key==null) return null;
 return prop.getProperty(key, defaultValue);
 
 }
}

配置文件common.properties(放在 src/main/resources下)

#aliyun business licence recognition
businessLicenceHost = https://dm-58.data.aliyun.com
businessLicencePath = /rest/160601/ocr/ocr_business_license.json
appCode = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

三、测试结果

成功的结果:

失败结果,当处理非营业执照的图片时将会返回“invalid business licence”结果,我这么没有进行判断处理直接按照正确的json解析,所以报错,此处你们可以按照自己需求选择处理逻辑。从这返回结果也看的出该接口做的不合理,返回内容不统一,导致接口使用者,必须知晓各种情况才能做有效的处理,如果此处能返回json串,给错误码那对于调用者来说就方便多了。

四、后记

此API适合一般的营业执照和新的三证合一的营业执照,但是字段获取的含义不同,此处需要注意;
由于API并未列出错误码,在未知的错误情况还包含识别次数不够的时候是报错还是有错误提示(由于条件限制,此情况无法验证);

工具是死的,人是活的,开发需要考虑尽可能多的情况,来保证代码的完善。
至此,工具介绍完毕,欢迎交流。

相关文章

  • mybatisPlus条件构造器常用方法小结

    mybatisPlus条件构造器常用方法小结

    这篇文章主要介绍了mybatisPlus条件构造器常用方法,首先是.select和其他条件,本文结合示例代码给大家介绍的非常详细,需要的朋友可以参考下
    2022-10-10
  • SpringBoot整合Mybatis实现高德地图定位并将数据存入数据库的步骤详解

    SpringBoot整合Mybatis实现高德地图定位并将数据存入数据库的步骤详解

    这篇文章主要介绍了SpringBoot整合Mybatis实现高德地图定位并将数据存入数据库的步骤详解,本文分步骤通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
    2021-01-01
  • 2022版IDEA创建一个maven项目的超详细图文教程

    2022版IDEA创建一个maven项目的超详细图文教程

    IDEA是用于java语言开发的集成环境,并且经常用于maven、spring、MyBatis等项目的开发,下面这篇文章主要给大家介绍了关于2022版IDEA创建一个maven项目的超详细图文教程,需要的朋友可以参考下
    2023-02-02
  • Springboot公共字段填充及ThreadLocal模块改进方案

    Springboot公共字段填充及ThreadLocal模块改进方案

    这篇文章主要为大家介绍了Springboot公共字段填充及ThreadLocal模块改进方案详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
    2022-11-11
  • 浅析Java中XPath和JsonPath以及SpEL的用法与对比

    浅析Java中XPath和JsonPath以及SpEL的用法与对比

    XPath,即XML路径语言,是一种用于在XML文档中查找信息的语言,JsonPath是从XPath中发展而来的,专门用于JSON数据格式,本文主要来讲讲他们的用法与区别,需要的可以参考下
    2023-11-11
  • 深入了解Java中的类加载机制

    深入了解Java中的类加载机制

    通常,在关于Java的类加载部分会遇到以上疑问,本文将对类加载重要部分做详细介绍,包括重要的基础概念和应用场景,在编写过程中也帮助作者重新熟悉并加固了知识点,希望在看完后对大家能有所帮助
    2022-11-11
  • Java BigDecimal基础用法详解

    Java BigDecimal基础用法详解

    Java在java.math包中提供的API类BigDecimal,用来对超过16位有效位的数进行精确的运算。双精度浮点型变量double可以处理16位有效数,但在实际应用中,可能需要对更大或者更小的数进行运算和处理
    2022-06-06
  • @Valid注解的作用及@Valid注解与@Validated的区别

    @Valid注解的作用及@Valid注解与@Validated的区别

    这篇文章主要介绍了@Valid注解的作用及@Valid注解与@Validated的区别,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2022-08-08
  • 详解Java的Spring框架中的事务管理方式

    详解Java的Spring框架中的事务管理方式

    这篇文章主要介绍了Java的Spring框架中的事务管理方式,Spring框架是Java的SSH三大web开发框架之一,需要的朋友可以参考下
    2015-12-12
  • 浅谈spring中用到的设计模式及应用场景

    浅谈spring中用到的设计模式及应用场景

    下面小编就为大家带来一篇浅谈spring中用到的设计模式及应用场景。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-08-08

最新评论

?


http://www.vxiaotou.com