- 浏览: 41237 次
最新评论
-
Hey_L:
很详细 受用了
百度云推送(Java实现)
文章列表
<Host name="i.fanfanol.com" appBase="/data/webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="ffzx_web" debug="0"/>
</Host> ...
- 2014-04-12 10:25
- 浏览 287
- 评论(0)
1.端口转发
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
2.查看端口占用
netstat –apn
3.编辑防火墙
vi /etc/sysconfig/iptables
4.开启防火墙
service iptables start
5.查看启动项
chkconfig
6.更改文件权限
chmod -R 777 /data/*
- 2014-04-11 12:21
- 浏览 372
- 评论(0)
Controller中
@ResponseBody
@RequestMapping(value = "/changeValidateKey")
public String addRoleView(HttpServletRequest request, HttpServletResponse response) throws Throwable {
String str = ZJ_GeneratorUtils.getRandomNumString(6);
request.getSession().setAttribute("vk", str) ...
- 2014-03-12 15:28
- 浏览 340
- 评论(0)
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ZJ_CookieUtils {
/**
* 设置cookie
*
* @param response
* @param name
* cookie名字
* @param ...
- 2014-03-12 10:25
- 浏览 333
- 评论(0)
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
i ...
- 2014-03-08 23:11
- 浏览 710
- 评论(0)
工具类
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Enumeration;
import java.util.Map;
import java.util.TreeMap;
import javax.servlet.http.HttpServletRequest;
/* ...
- 2014-03-08 20:30
- 浏览 385
- 评论(0)
/**
* MD5加密
*
* @param s
* @return
*/
private static String MD5(String s, String charsetname) {
char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
try {
byte[] strTemp;
if (null == charsetname || "".equals(charsetnam ...
- 2014-03-08 20:28
- 浏览 511
- 评论(0)
import java.security.MessageDigest;
public class ZJ_MD5Util {
private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c" ...
- 2014-03-08 20:26
- 浏览 453
- 评论(0)
字符串的内部表示?
字符串在java中统一用unicode表示( 即utf-16 LE) ,
对于String s = "你好哦!";
如果源码文件是GBK编码, 操作系统(windows)默认的环境编码为GBK,那么编译时, JVM将按照GBK编码将字节数组解析成字符,然后 ...
- 2014-03-08 14:13
- 浏览 377
- 评论(0)
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.UUID;
import com.yfapp.platform.entity.PushMessage;
import net.sf.js ...
- 2014-03-04 23:25
- 浏览 685
- 评论(1)
js再传值之前对中文两次编码
address = encodeURI(encodeURI(address));
java页面根据编码进行解码
address = java.net.URLDecoder.decode(address, "utf-8");
- 2014-02-26 23:09
- 浏览 291
- 评论(0)
<script type="text/javascript">
String.prototype.format = function() {
if (arguments.length == 0)
return this;
for (var s = this, i = 0; i < arguments.length; i++)
s = s.replace(new RegExp("\\{" + i + "\\}", "g"), arguments[i]);
return s;
...
- 2014-02-26 22:09
- 浏览 422
- 评论(0)
public static void main(String[] args) {
String str1 = "我叫%s,我是好'%s'";
String str2 = "我叫{0},我是好'{1}'";
// 方式一
String newstr1 = String.format(str1, "小明", "学生");
// 方式二
String newstr2 = MessageFormat.format(str2, "小明", "学生");
// 注意输出的差异 ...
- 2014-02-26 14:15
- 浏览 424
- 评论(0)
1.限制只能输入价格格式 如(11.11)
function limitPrice(obj) {
//保证不出现字母及其他
obj.value = obj.value.replace(/[^\d.]/g, "");
//保证只有出现一个.而没有连续多个.
obj.value = obj.value.replace(/[.]{2,}/g, ".");
//保证.只出现一次,而不能出现两次以上
obj.value = obj.value.replace(".", "#").replace ...
- 2014-02-24 09:19
- 浏览 194
- 评论(0)