Äêµ×ÊÕ²ØϵÁÐ Java Web¹¤¾ßSessionTick
package org.lambdasoft.web.support;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import org.lambdasoft.web.Enviroment;
public class SessionSupport {
private SessionSupport() {}
/**
* »ñÈ¡µ±Ç°Óû§Session
*
* @return httpSession
*/
public final static HttpSession getSession() {
return ServletActionContext.getRequest().getSession();
}
@SuppressWarnings("unchecked")
public final static void removeAllSession(HttpSession session) {
if(session == null)
return;
Enumeration names = session.getAttributeNames();
if(names == null)
return;
List<String> sessionNamesList = new ArrayList<String>();
while (names.hasMoreElements())
sessionNamesList.add((String)names.nextElement());
for (String sessionName : sessionNamesList) {
session.removeAttribute(sessionName);
}
}
/**
* Ìí¼Ó»òÕ߸üÐÂSessionƱ¾ÝÐÅÏ¢
*
* @param sessionTick
*/
public final static void updateSessionTick(SessionTick<TickInterface> sessionTick) {
getSession().removeAttribute(Enviroment.getEnv().getEnv("WEB_SESSION_KEY"));
getSession().setAttribute(Enviroment.getEnv().getEnv("WEB_SESSION_KEY"), sessionTick);
}
/**
* °ÑÓû§Æ±¾Ý¼ÓÈëµ½Session
* @param account
*/
public final static void addTickToSession(TickInterface account) {
SessionTick<TickInterface> tick = new SessionTick<TickInterface>();
tick.setAccount(account);
updateSessionTick(tick);
}
}
/*
* SessionTick.java
* Copyright (C) 2009 <JustinLei@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
*
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
Java ThreadÓÐÒ»¸ö volatile¹Ø¼ü×Ö£¬Ö÷ÒªÓÃÀ´·ÀÖ¹¶àÏ̷߳ÃÎʹ«¹²±äÁ¿£¬²»Äܼ°Ê±±»ÆäËüÏß³ÌÕýÈ··ÃÎÊ, ¶øÔì³ÉµÄ²»Í¬²½ÎÊÌâ¡£
±ÈÈçThreadA ºÍThreadB ͬʱ·ÃÎÊÒ»¸ö int a = 0; ²¢ÇÒÐ޸ģ¬
¿ÉÄÜ»áÔì³É ThreadA ÐÞ¸Äa±äÁ¿ºó£¬ThreadB·ÃÎÊa±äÁ¿»¹ÊÇÔÀ´µÄÖµ¡£
&n ......
1. ×Ö·û´®ÓÐÕûÐ͵ÄÏ໥ת»»
¡¡¡¡Java´úÂë
¡¡¡¡String a = String.valueOf(2); //integer to numeric string
¡¡¡¡int i = Integer.parseInt(a); //numeric string to an int
¡¡¡¡2. ÏòÎļþĩβÌí¼ÓÄÚÈÝ
¡¡¡¡Java´úÂë
¡¡¡¡BufferedWriter out = null;
¡¡¡¡try {
¡¡¡¡out = new BufferedWriter(new FileWr ......
¿´ÁËһƪÈëÃÅÎÄÕ£¬ºÃÏó²»´í£¬ÊÕ¼¯Ò»Ï£º
http://blog.csdn.net/njchenyi/archive/2007/09/12/1782252.aspx
ApacheµÄSOAP over CorbaµÄÎÄÕ£¬µ«Ê¹ÓÃÁËApache SOAP£¬Õâ¸ö±È½ÏÀÏÁË£¬ÏÖÔÚÓиüеÄAxis 2£¬ÀÁµÃÕÒSOAP API PackageÁË¡£
http://www.scottnichol.com/apachesoapcorba.htm
Ñо¿Ò»ÏÂCorba to SOAP Bridge£¬Óгɹ ......
/*
* EncryptUtils.java
* Copyright (C) 2007-3-19 <JustinLei@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ......