Äêµ×ÊÕ²ØÏµÁÐ 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
*
Ïà¹ØÎĵµ£º
JAVAµÄÉè¼ÆÔÔò
1. ½Ó¿Ú¸ôÀëÔÔò£¨ISP£ºInterface Segregation Principle£©
¶¨Ò壺ʹÓöà¸öרÃŵıÈʹÓõ¥Ò»µÄ×ܽӿÚÒªºÃ¡£Ò²¿ÉÒÔ˵£º½¨Á¢µ¥Ò»½Ó¿Ú£¬²»Òª½¨Á¢Ó·Ö×ÅÓ´óµÄ½Ó¿Ú¡£
ISPµÄÁ½ÖÖ¶¨Ò壺
¡ó “Clients should not be forced to depend upon interfaces that they don't u ......
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 ......
FileDialogÖ»ÄÜÑ¡ÔñÎļþ¶ø²»ÄÜÑ¡ÔñÎļþ¼Ð¡£JFileChooserÓÖÌ«´ó£¬²»Ì«ºÃ¿´£¬¹Äµ·Á˺ÃÒ»»áÖÕÓÚ½â¾öÁË¡£
¼Ç¼һϹؼü²¿·Ö´úÂ룬ÒÔ±¸²éÓá£
final JButton choose=new JButton("Ñ¡Ôñ´æ´¢ÎļþĿ¼");
final JTextField dir=new JTextField();
final JFileChooser chooser=new JFileChooser();
chooser.setFileSe ......
¿´ÁËһƪÈëÃÅÎÄÕ£¬ºÃÏó²»´í£¬ÊÕ¼¯Ò»Ï£º
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
* ......