ʵÀý½âÎöjava + jQuery + json¹¤×÷¹ý³Ì(µÇ¼)
´úÂëÑÝʾ£º
http://code.google.com/p/finance-p/source/browse/#svn/trunk
±¾ÎÄÖ÷Òª½²½âÔÚjava»·¾³ÏÂʹÓÃjQuery½øÐÐJSONÊý¾Ý´«Ë͵Ľ»»¥¹ý³Ì
²Î¿¼¸ù¾Ý×÷ÕßµÄÕËÎñ¹ÜÀíϵͳ(¸öÈË°æ) Ô´ÂëÏÂÔØ ½²½â
Ò»¡¢Ïà¹Ø¼¼Êõ¡¢¹¤¾ß¼ò½é
1¡¢¼òµ¥½éÉÜÒ»ÏÂJSON£¬JSONÊÇÒ»ÖÖÇáÁ¿¼¶µÄÊý¾Ý½»»»¸ñʽ¡£ Ò×ÓÚÈËÔĶÁºÍ±àд¡£Í¬Ê±Ò²Ò×ÓÚ»úÆ÷½âÎöºÍÉú³É¡£ÒѼüÖµ¶ÔÐÎʽ±íʾÊý¾Ý£¬ºÍjavaÖеÄMapµÄÊý¾Ý´æ´¢ÐÎʽÏàËÆ£¬¾ßÌåϸ½ÚÇë²Î¿¼http://www.json.org/json-zh.html¡£
2¡¢¶ÔÓ¦ºǫ́JSONµÄÊý¾Ý´¦Àí¹¤¾ßjson-lib£¬°üº¬¸÷ÖÖ¸ñʽÊý¾ÝµÄ¹¤¾ßÀ࣬±ÈÈ磺JavaBean¡¢Êý×é¡¢¼¯ºÏ(Collection)µÈ£¬²Î¿¼APIÎĵµ¡£
3¡¢jQuery¿ò¼ÜÖеÄÊý¾Ý±íÏÖÐÎʽ£¬Èç¹ûÄãÊìϤjQueryµÄ»°¾Í»á·¢ÏÖjQueryµÄʹÓõÄÊý¾Ý´«Ê䶼ÊÇJSON¸ñʽ£¬±ÈÈçÎÒÃǾ³£Ê¹ÓõÄ$.ajax·½·¨£º
$.ajax({
url : url,
data : {
id : chkValue
},
cache : false,
dataType : "json",
success : function(result){
alert(result);
}
);
ÆäÖÐ {…} ±íʾµÄ¾ÍÊÇJSON¸ñʽµÄÊý¾Ý
¶þ¡¢Ç°Ì¨¹¤×÷·½Ê½
ΪÁËÄܹ»ÈÝÒ×Àí½âÒÔϵͳµÇ¼½²½â£¬×îºó»áÒÔÒ»¸öʵÀýµÄ·½Ê½½²½â
1¡¢µÇ¼ҳÃæ
´úÂëÇë²Î¼û http://code.google.com/p/finance-p/source/browse/trunk/login.jsp
Óû§Ãû£º
<input id="loginName" name="loginName" size="20" type="text" />
ÃÜÂ룺
<input id="password" name="password" size="20" type="password" />
2¡¢µÇ¼javascriptÎļþ login.js
/**
* ÉèÖÃ±íµ¥ÑéÖ¤¹æÔò
*/
function regFormValidator() {
$.formValidator.initConfig({formid:"loginForm"});
$("#loginName").formValidator({
onshow : "ÇëÊäÈëÓû§Ãû",
onfocus : "Óû§ÃûÖÁÉÙ2¸ö×Ö,×î¶à4¸ö×Ö"
}).inputValidator({
min : 1,
onerror : "ÄãÊäÈëµÄÓû§Ãû·Ç·¨,ÇëÈ·ÈÏ"
});
$("#password").formValidator({
onshow : "ÇëÊäÈëÃÜÂë"
}).inputValidator({
min : 6,
onerror : "ÃÜÂëÔÚ6λÒÔÉÏ£¬ÇëÈ·ÈÏ"
});
}
$(function() {
// ×¢²á±íµ¥ÑéÖ¤²å¼þ
regFormValidator();
$('#submit').click(function(){
// ÑéÖ¤ÊäÈëµÄÓû§Ãû¡¢ÃÜÂëÊÇ·ñÕýÈ·
var valid = jQuery.formValidator.pageIsValid('1');
if (valid) {
$(this).attr('value', 'ÕýÔڵǼ……').attr('disabled', true);
} else {
return;
}
Ïà¹ØÎĵµ£º
Why NIO ?
http://onjava.com/pub/a/onjava/2002/09/04/nio.html?page=1
Java developers might ask: why introducing a new technology to handle sockets? What's wrong with the Java 1.3.x sockets? Suppose you would like to implement a server accepting diverse client connections. Suppose, as well, that you ......
Ò»¡¢Àí½â¶àÏß³Ì
¶àÏß³ÌÊÇÕâÑùÒ»ÖÖ»úÖÆ£¬ËüÔÊÐíÔÚ³ÌÐòÖв¢·¢Ö´Ðжà¸öÖ¸ÁîÁ÷£¬Ã¿¸öÖ¸ÁîÁ÷¶¼³ÆΪһ¸öỊ̈߳¬±Ë´Ë¼ä»¥Ïà¶ÀÁ¢¡£Ïß³ÌÓÖ³ÆΪÇáÁ¿¼¶½ø³Ì£¬ËüºÍ½ø³ÌÒ»ÑùÓµÓжÀÁ¢µÄÖ´ÐпØÖÆ£¬ÓɲÙ×÷ϵͳ¸ºÔðµ÷¶È£¬Çø±ðÔÚÓÚÏß³ÌûÓжÀÁ¢µÄ´æ´¢¿Õ¼ä£¬¶øÊǺÍËùÊô½ø³ÌÖеÄÆäËüÏ̹߳²ÏíÒ»¸ö´æ´¢¿Õ¼ä£¬ÕâʹµÃÏ̼߳äµÄͨ ......
ʹÓÃJava²Ù×÷Îı¾ÎļþµÄ·½·¨Ïê½â
ÕªÒª: ×î³õjavaÊDz»Ö§³Ö¶ÔÎı¾ÎļþµÄ´¦ÀíµÄ£¬ÎªÁËÃÖ²¹Õâ¸öȱº¶¶øÒýÈëÁËReaderºÍWriterÁ½¸öÀà
×î³õjavaÊDz»Ö§³Ö¶ÔÎı¾ÎļþµÄ´¦ÀíµÄ£¬ÎªÁËÃÖ²¹Õâ¸öȱº¶¶øÒýÈëÁËReaderºÍWriterÁ½¸öÀ࣬ÕâÁ½¸öÀ඼ÊdzéÏóÀ࣬WriterÖÐ write(char[] ch,int off,int
length)£¬flush()ºÍclose()·½·¨Îª³éÏó·½· ......
public static void replaceString(String source,String oldStr,String newStr){
System.out.println(source);
String result = source.replaceAll("(?i)"+oldStr
, newStr); //´óСд²»Ãô ......