
Java
Happy.Ending
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Java使用OSCache
libconfigure fileThese files should in the root of build.invoke in Javapublic List getObjectListFromOscache(){ List objectList = new ArrayList(); OsCache cache =原创 2013-08-01 21:48:31 · 1026 阅读 · 0 评论 -
Java通过JSON传递数据访问服务器
Client// the server URLprivate String url = "http://server_addr/project_name";public List commumicateWithServerByJSON(String para1, String para2){ List resultList = new ArrayList(); Object res原创 2013-07-26 21:47:33 · 1081 阅读 · 0 评论 -
Java获取HTTP客户端IP地址
客户端直接连接服务器public String getClientRealIp(HttpServletRequest request) { if(request.getHeader("x-forwarded-for") == null) return request.getRemoteAddr(); return request.原创 2013-07-26 21:43:17 · 902 阅读 · 0 评论 -
JSONP跨域访问
Extra JSImport JQuery, JSON and JQuery-JSONP.Client1) access with JSONPfunction testJSONP(para1, para2) { // generate a parameter JSON object var para = [ { 'para1' : para1, '原创 2013-08-03 18:12:34 · 483 阅读 · 0 评论 -
IKAnalyzer中文分词
Project structureIKAnalyzer.cfg.xmlThis the configuration file of IKAnalyzer, a sentence separator support Chinese. It must in the root of src. IK Analyzer extra configurationcn/原创 2013-07-27 21:26:36 · 1377 阅读 · 0 评论 -
MD5加密
public static String generateMD5Code(String code){ String resultString = null; try { MessageDigest messageDigest = MessageDigest.getInstance("MD5"); byte[] bytes = code.getBytes(); byte[] r原创 2013-07-29 10:43:16 · 750 阅读 · 0 评论 -
任务定时器
Create the Task ListenerMyContextListener.javapublic class MyContextListener implements ServletContextListener{ private java.util.Timer timer = null; public void contextInitialized(Servlet原创 2014-01-08 21:32:32 · 584 阅读 · 0 评论 -
判断链接是HTTP还是HTTPS
截取链接地址String URL = request.getRequestURL().toString();if(!URL.startsWith("https:")){ System.out.println("HTTPS");}获取协议if("https:" == document.location.protocol) alert("HTTPS")原创 2013-07-29 12:03:03 · 15199 阅读 · 0 评论 -
繁简体中文转换
libConvert sampleimport com.spreada.utils.chinese.ZHConverter;public class ChineseStringConverter{ /** * Convert Simplified String to Traditional String * * @param simplifiedStr原创 2014-12-25 11:59:34 · 958 阅读 · 0 评论