- 浏览: 72792 次
- 性别:
- 来自: 北京
-
最新评论
文章列表
/**
* 生成固定长度的随机字符和数字
* @param len
* @return
*/
public static String GetRandomCharAndNumber(int len) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i <len; i++) {
int intRand = (int) (Math.random() * 52);
int numValue = (in ...
- 2013-03-18 17:58
- 浏览 905
- 评论(0)
package com.util;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.util.Enumeration; ...
- 2013-03-01 15:08
- 浏览 345
- 评论(0)
<HTML><HEAD><TITLE>WMI Scripting HTML</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<SCRIPT language=JScript event="OnCompleted(hResult,pErrorObject, pAsyncContext)" for=foo>
document.forms[0].txtMACAddr.value=un ...
- 2013-02-21 14:51
- 浏览 385
- 评论(0)
采用JAVA 获取google analytics产生的流量检测数据。
配置:JDK5.0及以上
GoogleAnalytics.java
package com.cms.util;
// Copyright 2010 Google Inc. All Rights Reserved.
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. ...
- 2013-02-19 17:15
- 浏览 415
- 评论(0)
String wpu_no= "1";
String wpu_url= "2";
String wpu_pr_url="3";
String wpu_page_name="4";
String wpu_page_type="5";
HashMap map=new HashMap();
map.put("wpu_no",wpu_no);
map.put("wpu_url",wpu_ ...
- 2013-02-18 15:28
- 浏览 579
- 评论(0)
java 用struts2 提交一个表单,表单内容太长,报这个错很容易看到是表单input的问题,于是我找啊找~~每一个字段每一个字段的对比与数据库无异,我就特别奇怪为什么会提示这样的错误而且还是404。最终无数遍查找后找到原因是:Bean 配置与实际得到的值的类型不一致导致。。一气之下全部改成String类型成功了......
- 2013-01-30 14:03
- 浏览 322
- 评论(0)
<ul id="ul">
<li id=1>11111111111111111<a href="javascript:del(1);">del</a></li>
<li id=2 >22222222222222222<a href="javascript:del(2);">del</a></li>
<li id=3>33333333333333333<a href="javascript:de ...
- 2013-01-25 15:31
- 浏览 842
- 评论(0)
package com.sayes.util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
public class ProTimer {
public void StartTimer(String date,final String Close){
//"2013-01-17 16:25:00&quo ...
- 2013-01-17 16:21
- 浏览 253
- 评论(0)
主要是一个CSS样式控制和一个META标签;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META NAME="save" CO ...
- 2013-01-15 12:22
- 浏览 367
- 评论(0)
<script>
function doit(){
newT=document.selection.createRange()
clipboardData.setData("Text",newT.text)
if(clipboardData.getData("Text")!=null){
document.all.pp.value=clipboardData.getData("Text")
}
}
</script>
<span id=ww onmou ...
- 2013-01-10 15:55
- 浏览 535
- 评论(0)
网上发的EMAIL正则有的不可用,收藏一个不错的。
var reMail = /^(?:[a-zA-Z0-9]+[_\-\+\.]?)*[a-zA-Z0-9]+@(?:([a-zA-Z0-9]+[_\-]?)*[a-zA-Z0-9]+\.)+([a-zA-Z]{2,})+$/;
JS,数字比较强转一下
parseInt(str)>10
function $$(id){//多一些这样的方法就好了
var obj=document.getElementById(id);
return obj;
}
- 2013-01-04 19:26
- 浏览 306
- 评论(0)
为了减轻数据库压力和提高加载速度,生成了纯JSON文件,想在本地自动分页,找了N多API均没有详细的介绍,在一次加载属性时加入了loadonce:true属性结果发现jqGrid自带的分页功能生效了。哎,总算解决了问题。官方的API不知是写的不够清楚,还是本人理解有问题,花费这么多时间在这个分页上面。解决就好,遂与大家分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd& ...
- 2012-12-11 16:35
- 浏览 364
- 评论(0)
在JSP接收URL传过来的参数时,总是拿到乱码,查看了网上很多的方法均无解。
试过title=new String(request.getParameter("title").getBytes("ISO-8859-1"),"utf-8");
本地测试title=new String(request.getParameter("title").getBytes("ISO-8859-1"),"gb2312");//本地正常//服务器乱码
研究一下午最终发现竟然是 ...
- 2012-12-04 17:27
- 浏览 326
- 评论(0)
Instr方法截取in的排序做为数据的排序有时候也是不错的途径
SELECT wdy_short_name,
d.wdy_pid pid,
d.wdy_id idd
FROM web_DICTIONARY d
WHERE d.wdy_id in (402, 377, 443, 465)
order by instr('402,377,443,465', ltrim(d.wdy_id))
- 2012-11-05 19:24
- 浏览 1026
- 评论(0)
JSF
优点:
◆Java EE标准,这意味着有很大的市场需求和更多的工作机会
◆上手快速并且相对容易
◆有大量可用的组件库
缺点:
◆大量的JSP标签
◆对REST和安全支持不好
◆没有一个统一的实现。既有SUN的实现,又有Apache的实现——MyFaces。
◆国内的OperaMasks还支持AJAX,以及有开发工具支持
Spring MVC
优点:
◆对覆盖绑定(overriding binding)、验证(validation)等提供生命周期管理
◆与许多表示层技术/框架无缝集成: ...
- 2012-10-19 11:43
- 浏览 379
- 评论(0)