`
文章列表

XML解析

    博客分类:
  • XML
参考:http://blog.csdn.net/yuan16423276/article/details/17385867 第一种,直接读取流: private static Map<String, String> parseXml(HttpServletRequest request){ try { InputStream is = request.getInputStream(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBui ...
1、注册微信公众订阅号 2、服务器配置: URL(服务器地址):rest/portal/getWeixinTokenToken (令牌):XXX EncodingAESKey(消息加解密密钥):VzfRmFPyc7BNm84OzNHIY5EwfTkbGmgodF58OW0ZouW 消息加解密方式:明文模式  3、微信公众号发送消息到服务器首先会访问get方法验证token,然后访问post方法将消息推送到服务器            URL:用Java编写,部署到服务器   第一步,访问get方法,验证token   import java.io ...
String.format("%06d",111)  不足填前面填0
1,去官网ckeditor.com下载ckeditor_3.6.2.zip和http://cksource.com/下载ckfinder_java_2.4.1.zip,然后分别解压出来为ckeditor文件和ckfinder文件项目中webRoot目录下   2,在jsp页面导入js <script type="text/javascript" src="ckeditor/ckeditor.js"></script><script type="text/javascript" src=" ...
一、在layout下创建TabHost的home.xml <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tabhost" android:layout_width="fill_parent" android:layout_height=&quo ...
一、 MySQL 数据库分页查询 MySQL数据库实现分页比较简单,提供了LIMIT函数。一般只需要直接写到sql语句后面就行了。 LIMIT子句可以用来限制由SELECT语句返回过来的数据数量,它有一个或两个参数,如果给出两个参数, 第一个参数指定返回的第一行在所有数据中的位置,从0开始(注意不是1),第二个参数指定最多返回行数。例如: select * from table WHERE … LIMIT 10; #返回前10行 select * from table WHERE … LIMIT 0,10; #返回前10行 select * from table WHER ...
//解决Android4.0不能在主线程中进行HTTP请求 //在Android4.0以后,会发现,只要是写在主线程(就是Activity)中的HTTP请求,运行时都会报错,这是因为Android在4.0以后为了防止应用的ANR(aplication Not Response)异常. //就针对此问题有两种解决的方法: //1.可以再Activity的onCreate()方法中加入这样一段代码,如下: if (Build.VERSION.SDK_INT >= 11) { StrictMode.setThreadPolicy(ne ...
String str = "[dt=2013-02-20 09:35:26];[sid=2001];[cat=LOGIN];[pid=631];[grade=90,100];[alltime=2601962];[aid=seanlove];[wallet=360,1584095,240];[ip=121.9.243.14];[do=login];[name=二]"; str = str.toString().trim().replace("];[", "','"); str = str.replace(" ...

java读取txt文件

    博客分类:
  • java
public static void main(String arg[]) { try { String encoding = "GBK"; // 字符编码(可解决中文乱码问题 ) File file = new File("e:/aa.txt"); if (file.isFile() && file.exists()) { InputStreamReader read = new InputStreamReader( new FileInputStream(file), encoding); BufferedReader ...
//java代码 ApplicationContext context = new ClassPathXmlApplicationContext("classpath*:/hostBean.xml"); HostBean hostBean = (HostBean)context.getBean("hostBean"); String host = hostBean.getHost(); String url = hostBean.getUrl(); //HostBean.java public class H ...

ssh定时器

    博客分类:
  • SSH
<bean id="mainExecutor" class="com.gamemag.thread.syn.impl.MainExecutor"> <!-- 元宝消耗方向统计 --> <property name="checkRun1"> <list> <value>${checkRun1.start}</value><!-- 是否执行,true 执行 , false 不执行 --> < ...
function createXMLHttpRequest(){ if(window.XMLHttpRequest) { //Mozilla 浏览器 XMLHttpReq = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE浏览器 try { XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { XMLHt ...
s={["name":"张三","age":18],["name":"李四","age":19]}; //s= [{"studno":"122222","studname":"wwww","studsex":"男"},{"studno":"11111","studname":"xxxx ...
新建一个SecondTest.html页面,定义一个按钮,并给这个按钮绑定事件ajaxJson()。在JS中实现AJAX,这里的AJAX相对于上一篇中的,我做了简单的封装,将原有的代码分成三个方法,分别是create()、callback()、run()。   create方法是用来创建XMLHttp对象的,callback是用来实现回调函数的,run方法是核心方法。具体代码如下:   create(): View Code function create(){ if(window.XMLHttpRequest){ ...

DIV

 
div不允许换行:<div id="style" style="display:inline;" ></div> div显示:<div id="style" style="display: block;" ></div>  div隐藏:<div id="style" style="display: none;" ></div>  whichEl = document.getElementById(& ...
Global site tag (gtag.js) - Google Analytics