上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 29 下一页

调用第三方接口的具体代码

摘要: private String getKobe(String mburl){ URL url = null; BufferedReader reader = null; String str=""; try { url = new URL(mburl); reader = new BufferedReader(new InputStreamReader(url.openStream(),"UTF-8"));String line=null; do { line = reader.readLine(); if(line!=null) { str +=line 阅读全文
posted @ 2013-02-28 09:56 专注2018 阅读(403) 评论(0) 推荐(0) 编辑

java中使用request,application,session,cookie对象

摘要: 导入包:import javax.servlet.ServletContext;import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.servlet.http.HttpSession;import org.apache.struts2.ServletActionContext; import org.apache.struts2.interceptor.CookiesAwar 阅读全文
posted @ 2013-02-28 09:51 专注2018 阅读(2689) 评论(0) 推荐(0) 编辑

获取时间戳,以秒为单位

摘要: import java.util.Date;String tstamp = getUnixTime(new Date())+"";public static long getUnixTime(Date date){ if( null == date ) { return 0; } return date.getTime()/1000;} 阅读全文
posted @ 2013-02-28 09:46 专注2018 阅读(982) 评论(0) 推荐(0) 编辑

通过ajax传值,出现的乱码和特殊字符问题

摘要: 问题描述:通过ajax传值,有时出现乱码和特殊字符。传中文出现乱码,传密码,对特殊字符的处理有问题。如jsp中输入的密码是:1111++11,在java中获取时是:1111 11.解决思路:通过加密和解密操作实现。(采取encodeURIComponent)具体如下:jsp页面中,password="+encodeURIComponent(encodeURIComponent(password));java中password = java.net.URLDecoder.decode(password,"UTF-8"); 阅读全文
posted @ 2013-02-28 09:31 专注2018 阅读(549) 评论(0) 推荐(0) 编辑

已经复制到剪贴板!实现代码

摘要: <HTML><HEAD> <TITLE>copy</TITLE> <SCRIPT language=javascript type=text/javascript> function kobe() { var url = document.getElementById("kobe").value; window.clipboardData.setData("Text",url); alert("已经复制到剪贴板!");} </SCRIPT></HEAD> 阅读全文
posted @ 2013-02-18 17:18 专注2018 阅读(278) 评论(0) 推荐(0) 编辑

解决ajax传递中文参数,出现乱码的问题

摘要: 1、jsp页面照常传递参数。2、java页面接收时,String bt = request.getParameter("bt");if(bt!=""){ try { bt = new String(bt.getBytes("ISO-8859-1"),"utf-8"); } catch(UnsupportedEncodingException e) { e.printStackTrace(); }} 阅读全文
posted @ 2013-01-27 16:07 专注2018 阅读(264) 评论(0) 推荐(0) 编辑

Eclipse+MyEclipse总是显示quick update的解决办法

摘要: 1、Windows > Preferences > MyEclipse Enterprise Workbench > Community Essentials, 把选项 "Search for new features on startup"的前勾去掉即可。2、另外关闭的Eclipse的自动更新:Windows > Preferences > Install/Update>automatic update,去掉automatically find new update and notify me的勾。 阅读全文
posted @ 2013-01-26 09:59 专注2018 阅读(304) 评论(0) 推荐(0) 编辑

<c:forEach 的常用整理

摘要: <c:forEach items="${images}" var="img" varStatus="status"> <div style="float:left;margin-right:10px;"> <img src="${ctx}${img.img_url}" width="500px" height="400px"/> </div></c:forEach>获取<c:forEach的 阅读全文
posted @ 2013-01-24 13:38 专注2018 阅读(20554) 评论(0) 推荐(1) 编辑

jquery显示div的方法

摘要: 隐藏代码:<div id="bgy" style="display:none;"></div>显示方式:$("#bgy").css("display","block");//第1种方法$("#bgy").attr("style","display:block;");//第2种方法$("#bgy").show();//第3种方法注:等同的js方法document.getElementById(& 阅读全文
posted @ 2013-01-16 13:14 专注2018 阅读(348) 评论(0) 推荐(0) 编辑

js直接关闭当前页面

摘要: window.opener=null;window.open('','_self');window.close(); 阅读全文
posted @ 2012-12-29 13:10 专注2018 阅读(158) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 29 下一页