Java URLÕýÔò±í´ïʽ
ÍøÉÏתÌùµÄJavaÕýÔòºÜÈÃÈËʧÍû£¬Ò»ÆªJavaScriptÕýÔò¼¯Â¼±»ºÜ¶à²»¸ºÔðÈεÄÈËתÀ´×ªÈ¥£¬²¢´òÉÏJavaÕýÔòµÄ±êÌ⣬º¹£¬ÕæÊÇÀÃÈËÒ»¶Ñ¡£
// urlÕýÔò
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegularExpressionTest {
public static void main(String[] args) {
Pattern p = Pattern.compile("^(http|www|ftp|)?(://)?(\\w+(-\\w+)*)(\\.(\\w+(-\\w+)*))*((:\\d+)?)(/(\\w+(-\\w+)*))*(\\.?(\\w)*)(\\?)?(((\\w*%)*(\\w*\\?)*(\\w*:)*(\\w*\\+)*(\\w*\\.)*(\\w*&)*(\\w*-)*(\\w*=)*(\\w*%)*(\\w*\\?)*(\\w*:)*(\\w*\\+)*(\\w*\\.)*(\\w*&)*(\\w*-)*(\\w*=)*)*(\\w*)*)$",Pattern.CASE_INSENSITIVE );
Matcher m = p.matcher("http://www.qqgb.com/Program/Java/JavaFAQ/JavaJ2SE/Program_146959.html");
if(m.find()){
System.out.println(m.group());
}
m = p.matcher("http://baike.baidu.com/view/230199.htm?fr=ala0_1");
if(m.find()){
System.out.println(m.group());
}
m = p.matcher("http://www.google.cn/gwt/x?u=http%3A%2F%2Fanotherbug.blog.chinajavaworld.com%2Fentry%2F4550%2F0%2F&btnGo=Go&source=wax&ie=UTF-8&oe=UTF-8");
if(m.find()){
System.out.println(m.group());
}
m = p.matcher("http://zh.wikipedia.org:80/wiki/Special:Search?search=tielu&go=Go");
if(m.find()){
System.out.println(m.group());
}
}
}
ÔËÐнá¹û£º
http://www.qqgb.com/Program/Java/JavaFAQ/JavaJ2SE/Program_146959.html
http://baike.baidu.com/view/230199.htm?fr=ala0_1
http://www.google.cn/gwt/x?u=http%3A%2F%2Fanotherbug.blog.chinajavaworld.com%2Fentry%2F4550%2F0%2F&btnGo=Go&source=wax&ie=UTF-8&oe=UTF-8
http://zh.wikipedia.org:80/wiki/Special:Search?search=tielu&go=Go
˵Ã÷Õ⼸ÖÖÀàÐ͵Ķ¼¿ÉÒÔʶ±ð¡£
//ÆäËûJavaÕýÔò¡¾×ª×Ôitpub¡¿
01¡¢"^\\d+$"¡¡¡¡//·Ç¸ºÕûÊý£¨ÕýÕûÊý + 0£©
¡¡¡¡02¡¢"^[0-9]*[1-9][0-9]*$"¡¡¡¡//
Ïà¹ØÎĵµ£º
1. StrutsÌåϵ½á¹¹ÊµÏÖÁËMVCÉè¼ÆģʽµÄ¸ÅÄÄÇôËü½«ÒÔÏÂÑ¡ÏîÖиø³öµÄʲô·Ö±ðÓ³ÉäΪwebÓ¦ÓÃÖеÄ×é¼þ£¿£¨ £©
A View
B Model
C ActionServlet
D Action
E ActionMapping
F Controller
²Î¿¼´ð°¸£ºABF
2. ÔÚStrutsÌåϵ½á¹¹ÖУ¬ÒÔÏÂÄĸöÓÉ´ú±íϵͳ״̬ºÍÉÌÒµÂß¼µÄActionÀ´¹¹½¨ ......
¶¨ÒåÔÚÒ»¸öÀàÄÚ²¿µÄÀà½ÐÄÚ²¿À࣬°üº¬ÄÚ²¿ÀàµÄÀà³ÆΪÍⲿÀà¡£ÄÚ²¿Àà¿ÉÒÔÉùÃ÷public¡¢protected¡¢privateµÈ·ÃÎÊÏÞÖÆ£¬¿ÉÒÔÉùÃ÷ΪabstractµÄ¹©ÆäËûÄÚ²¿Àà»òÍⲿÀà¼Ì³ÐÓëÀ©Õ¹£¬»òÕßÉùÃ÷Ϊstatic¡¢finalµÄ£¬Ò²¿ÉÒÔʵÏÖÌض¨µÄ½Ó¿Ú¡£staticµÄÄÚ²¿ÀàÐÐΪÉÏÏóÒ»¸ö¶ÀÁ¢µÄÀ࣬·ÇstaticÔÚÐÐΪÉÏÀàËÆÀàµÄÊôÐÔ»ò·½·¨ÇÒ½ûÖ¹ÉùÃ÷staticµÄ·½· ......
http://51jsp.cn/post/23.html
ÏÖÔÚ×öÍøÕ¾Ê×ÏÈ¿¼ÂÇÒ»µã¾ÍÊDz»ÄÜÔÚ×Ô¼ºµÄÍøÕ¾ÖгöÏÖ·Ç·¨µÄ¶«Î÷£¬°üÀ¨Ò»Ð©Ãô¸ÐµÄ´Ê¡£ÏÖÔÚÎÒÃǾÍÀ´¼òµ¥µÄʵÏÖËü£¬ÎªÁ˲éÕҵĿìËÙÔÚÕâÓÃtxtÀ´±£´æÕâЩ·Ç·¨µÄ¹Ø¼ü´Ê¡£Õâ¸öTXTÎĵµÊÇÔÚÍøÉÏÕÒµ½£¬ÏÖÔÚ´«ÉÏÀ´200907261131128065.rar
ÓÃJAVA³ÌÐòʵÏÖ¼òµ¥µÄÌí¼ÓÑéÖ¤¹Ø¼ü´Ê£¬Èç¹û´ó¼ÒҪʵ¼ÊÖÐʹÓã¬Ìí ......
1.¼ÆËãijһÔ·ݵÄ×î´óÌìÊý
Calendar time=Calendar.getInstance();
time.clear();
time.set(Calendar.YEAR,year); //year Ϊ int
time.set(Calendar.MONTH,i-1);//×¢Òâ,Calendar¶ÔÏóĬÈÏÒ»ÔÂΪ0
int day=time.getActualMaximum(Calendar.DAY_OF_MONTH) ......
ͻ񻣼
±¾ÎÄÕë¶Ôjava³õѧÕß»òÕßannotation³õ´ÎʹÓÃÕßÈ«ÃæµØ˵Ã÷ÁËannotationµÄʹÓ÷½·¨¡¢¶¨Ò巽ʽ¡¢·ÖÀà¡£³õѧÕß¿ÉÒÔͨ¹ýÒÔÉϵÄ˵Ã÷ÖÆ×÷¼òµ¥µÄannotation³ÌÐò£¬µ«ÊǶÔÓÚһЩ¸ß¼¶µÄannotationÓ¦Óã¨ÀýÈçʹÓÃ×Ô¶¨ÒåannotationÉú³ÉjavabeanÓ³ÉäxmlÎļþ£©»¹ÐèÒª½øÒ»²½µÄÑо¿ºÍ̽ÌÖ¡£Éæ¼°µ½ÉîÈëannotationµÄÄÚÈÝ£¬×÷Õß½«ÔÚºóÎÄ¡ ......