随笔分类 - JAVA
JAVA一些常用的方法
    
摘要:官网接口地址:https://developers.weixin.qq.com/doc/offiaccount/Custom_Menus/Creating_Custom-Defined_Menu.html //创建一个微信菜单实体类 WeixinMenu.java package com.weixi
        阅读全文
                
摘要:天气接口地址:http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl 1、打开项目文件目录路径文件夹,在当前文件夹打开cmd,输入 wsimport -keep -p demo.cyj.service -verbose htt
        阅读全文
                
摘要:一、导入jar包 poi-3.7.jarpoi-scratchpad-3.7.jarpoi-examples-3.7.jarpoi-ooxml-3.7.jarpoi-ooxml-schemas-3.7.jar xmlbeans-2.3.0.jar maven <dependency> <groupI
        阅读全文
                
摘要:对页面传入的参数值进行过滤,过滤方法如下 public static String xssEncode(String s) { if (s == null || s.equals("")) { return s; } try { s = URLDecoder.decode(s, "UTF-8"); 
        阅读全文
                
摘要:新增一个拦截器,在拦截器doFilter()方法增加以下代码
        阅读全文
                
摘要:一、点击File-New-Project,选择Spring initializr ,选择jdk1.8及以上 二、填写相关信息,点击Next 3、选择Web -Spring Web,点击Next 4、输入项目名和选择项目路径 点击Finish,项目就创建完成了
        阅读全文
                
摘要:在settings.xml文件中的mirrors下添加mirror标签 <!-- 阿里云仓库 --> <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>http://maven
        阅读全文
                
摘要:/** * * @param urlStr 接口地址 * @param xmlInfo xml格式参数数据 * @return */ public static String sendMsgXml(String urlStr, String xmlInfo) { StringBuffer buffer = new StringBuffer(); try { URL url = new URL(ur
        阅读全文
                
摘要:/** * java获取raw */ public static String readRaw(InputStream inputStream) { String result = ""; try { ByteArrayOutputStream outSteam = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int l
        阅读全文
                
摘要:/** * 获取指定日期是星期几<br> * * @param date * @return 指定日期是星期几 */ public static String getWeekOfDate(Date date) { String[] weekDays = { "星期日", "星期一", "星期二", 
        阅读全文
                
摘要:public static Map getLngAndLat(String address) { Map map = new HashMap(); String url = "http://api.map.baidu.com/geocoder/v2/?address=" + address + "&output=json&ak=你的ak"; //这里需要自己申...
        阅读全文
                
摘要://java 通过url下载图片保存到本地 public static void download(String urlString, int i) throws Exception { // 构造URL URL url = new URL(urlString); // 打开连接 URLConnection con = u...
        阅读全文
                
摘要:首先先要导入pinyin4j-2.5.0.jar 这个jar包
        阅读全文
                
摘要:public static String getSixNum() { String str = "0123456789"; StringBuilder sb = new StringBuilder(4); for (int i = 0; i < 6; i++) { char ch = str.charAt(new Random().nextInt(str.length()));...
        阅读全文
                
摘要:Enumeration<String> paraNames=request.getParameterNames(); for(Enumeration<String> e=paraNames;e.hasMoreElements()){ String thisName=e.nextElement()+"
        阅读全文
                
摘要:public static List getImg(String htmlStr) { List list = new ArrayList(); String img = ""; Pattern p_image; Matcher m_image; // String regEx_img = "]*?>"; //图片链...
        阅读全文
                
摘要:package com.common.util; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 检测是否为移动端设备访问 * */ public class CheckMobile { // \b 是单词边
        阅读全文
                
摘要:注:不是所有的字都支持,如果对识别要求特别高的,不建议使用 import java.io.UnsupportedEncodingException; /** * 取得给定汉字串的首字母串,即声母串 * Title: ChineseCharToEn * @date 注:只支持GB2312字符集中的汉字
        阅读全文
                
摘要:可以直接使用hutool的date工具类 cn.hutool.core.date.DateUtil beginOfDay : 获取某天的开始时间endOfDay :获取某天的结束时间 DateUtils.java import java.text.DateFormat; import java.te
        阅读全文
                
摘要:微信官方文档:https://pay.weixin.qq.com/wiki/doc/api/index.html获取API证书:https://kf.qq.com/faq/161222NneAJf161222U7fARv.html本地开发环境支付回调调试方法可以参考:https://www.cnbl
        阅读全文
                
 
                     
                    
                 
                    
                
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号