Download Eclipse
Download WTP
Download JSF
Download The EMF driver used in this build is emf-sdo-xsd-SDK-2.2.2.zip
Download The GEF driver used in this build is GEF-SDK-3.2.2.zip
Download
Java EMF Model Runtime driver used in this build is JEM-SDK-1.2.3_jem.zip
Download xdoclet
Download Rich Ajax Project RAP
Unzip them and copy plugins into
Eclipse.
3、Download Myfaces from apache.org
4、Download WAS CE & Eclips plugin from IBM, Install them.
5、當然不能少了JDK from java.sun.com;
差不多就這樣了,在Eclipse還要配置一下WAS CE。
詳細文章參見 管理 Eclipse 中的WAS CE服務器。
J2SE在java.security.MessageDigest提供了一個MD5、SHA摘要計算類。
結合javascript的md5計算,可以實現前臺口令加密,后臺數據庫中也保存的是md5或者sha的密碼加密摘要。
具體實現如下:
1、login.jsp部分
...
<script type="text/javascript" src='js/md5.js'>
</script>
<html:form action="/login" focus="userid" >
<table class="SubFormStyle">
<tr align=left>
<td><bean:message key="caption.LOGIN.UserID" /> <html:text
property="userid" value=""></html:text></td>
<td><bean:message key="caption.LOGIN.Password" /> <html:password
property="passwordinput" value=""></html:password>
<html:hidden
property="password" value="" ></html:hidden></td>
<td><html:submit onclick="password.value = hex_md5(passwordinput.value);">
<bean:message key="button.Login" />
</html:submit></td>
</tr>
</table>
</html:form>
...
2、我用的是struts,具體的action和form就不再浪費紙張了,我定義了一個loginuser的類來進行用戶密碼校驗,這里只給出校驗的方法:
/**
*
* 校驗密碼,密碼采用MD5算法加密。
*
* @Param PasswordInput, 待校驗密碼
* @Return 校驗通過返回true,否則返回false
*
*
*/
public boolean CheckPassword(String PasswordInput) throws ATError {
this.select();//從數據庫中讀取用戶信息
MessageDigest md;
try {
//生成一個MD5加密計算摘要
md = MessageDigest.getInstance("MD5");
//計算md5函數
md.update(this.password.getBytes());
//digest()最后確定返回md5 hash值,返回值為8為字符串。因為md5 hash值是16位的hex值,實際上就是8位的字符
//BigInteger函數則將8位的字符串轉換成16位hex值,用字符串來表示;得到字符串形式的hash值
String pwd = new BigInteger(1, md.digest()).toString(16);
if (PasswordInput.equals(pwd)) {
return true;
} else {
return false;
}
} catch (NoSuchAlgorithmException e) {
throw new ATError(e, "LoginUser", "CheckPassword", 1000);
}
}
md5.js下載:http://pajhome.org.uk/crypt/md5/index.html
一開始覺得別人走得很遠了,我們大概沒有機會了。實際上不是這樣,我們不光有成本優勢,還有速度優勢、技術優勢,致使過去沒有把我們的技術集成起來。
——奇瑞汽車總裁尹同耀宗杰奇瑞
| |||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
---|---|---|---|---|---|---|---|---|---|
25 | 26 | 27 | 28 | 29 | 30 | 31 | |||
1 | 2 | 3 | 4 | 5 | 6 | 7 | |||
8 | 9 | 10 | 11 | 12 | 13 | 14 | |||
15 | 16 | 17 | 18 | 19 | 20 | 21 | |||
22 | 23 | 24 | 25 | 26 | 27 | 28 | |||
29 | 30 | 1 | 2 | 3 | 4 | 5 |