Java ¿ª·¢ÖÐÓõ½µÄ¼¸ÖÖ¹ýÂËÆ÷
ÔÚJavaÖÐÓÐʱ»áÓö¼ûÂÒÂëµÄÇé¿ö£¬ÕâÀïÌṩÁ˼¸ÖÖת»»·½·¨
£¨Ò»£©JavaÖеıàÂëת»»
£¨¶þ£©¿ÉÒÔÔÚweb.xmlÎļþÖÐÅäÖõÄ×Ô¼ºÐ´µÄ¹ýÂËÆ÷
µÚÒ»ÖÖ·½·¨×î¼òµ¥Ò²×î·½±ã£¬µ«ÊÇÖ»ÄÜÓÃÔÚÉÙÁ¿µÄµØ·½»òÊÇż¶ûÒ»Á½´ÎתÂ룬Èç¹û´óÃæ»ýʹÓþͲ»·½±ãÁË£¬Ò²´ó´óÔö¼ÓÁ˱àÂëÁ¿£¬Èç¹ûÄãµÄÏîÄ¿ÀïûÓÐÓÃSpringµÄ¿ò¼Ü¿ª·¢£¬ÓÃweb.xmlÅäÖÃ×Ô¶¨Òå¹ýÂËÆ÷¿ÉÒÔÒ»ÀÍÓÀÒݵĽâ¾ö
1.Ê×ÏÈÒª±àд×Ô¼ºµÄ¹ýÂËÆ÷Àà(ʵÏÖÁËjavax.servlet.Filter)£º
package fck.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class CodeFilter implements Filter {
public void destroy() {
// TODO Auto-generated method stub
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filter) throws IOException, ServletException {
// TODO Auto-generated method stub
request.setCharacterEncoding("utf-8");
filter.doFilter(request, response);
}
public void init(FilterConfig arg0) throws ServletException {
// TODO Auto-generated method stub
}
}
2.ÔÚweb.xmlÎļþÖбàд¹ýÂËÆ÷ÅäÖãº
<filter>
<!--CodeFilterÊÇ×Ô¼ºËæ±ãÈ¡µÄÃû×Ö-->
<filter-name>CodeFilter</filter-name>
<!--дºÃ¶ÔÓ¦µÄ¹ýÂËÆ÷ÀàµÄ·¾¶-->
<filter-class>fck.filter.CodeFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CodeFilter</filter-name>
<!--“/*”´ú±íËùÓеÄÇëÇ󶼾¹ý¹ýÂË-->
<url-pattern>/*</url-pattern>
</filter-mapping>
Ö®ºó²»ÓÃÔÙ×öʲô´úÂëµÄ¸Ä±ä£¬¹ýÂËÆ÷¾Í½«ËùÓеķÃÎʶ¼×ªÂëÁË
(Èý)ʹä¯ÀÀÆ÷²»»º´æÒ³ÃæµÄ¹ýÂËÆ÷
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/** *//**
* ÓÃÓÚµÄ
Ïà¹ØÎĵµ£º
Èç½ñ·¢ÏÖjavaÔ½À´Ô½ÄÑÕÒ¹¤×÷ÁË£¬Ò»¸ö´óÖØÇì¼ÈÈ»ÕÐƸjavaµÄ¹«Ë¾²»µ½3¼Ò£¬²¢ÇÒÒªÇ󻹸ßÄØ¡£Í»È»¸Ð¾õÏòÎÒÃÇÕâÑù´ÓѧУÅàѵ³öÀ´µÄ£¬Ñ§ÀúÒ²²»ÊǺøߵģ¬ÕæµÄ»î²»ÏÂÈ¥ÁË¡£ÕâÊÀµÀ£¬Ã÷Ã÷ÖйúÕâôȱÈí¼þ¿ª·¢µÄΪʲô£¬ÎÒÃÇ»¹ÊÇûµÃ»ú»á±»¹«Ë¾Â¼ÓÃÄØ¡£ÆàÁ¹¡£ ......
ΪÁË͵ÀÁ£¬×¨ÃÅÓÃÁËJAVA¸ß¾«¡£¹ûÈ»ºÜ¼òµ¥¡£µ«ÊÇÔÚʹÓÃÇ°Ò»¶¨Òª×¢ÒâÉóÌ⣬ÓÐʱºò¸ù±¾²»ÐèÒªÓø߾«¼ÆËã¡£Ò»¶¨ÒªÓп´ÇåÌõ¼þ¡£
BigInteger
&nb ......
Ò»¡¢PO:
persistant object
³Ö¾Ã¶ÔÏó,¿ÉÒÔ¿´³ÉÊÇÓëÊý¾Ý¿âÖеıíÏàÓ³ÉäµÄjava¶ÔÏó¡£×î¼òµ¥µÄPO¾ÍÊǶÔÓ¦Êý¾Ý¿âÖÐij¸ö±íÖеÄÒ»Ìõ¼Ç¼£¬¶à¸ö¼Ç¼¿ÉÒÔÓÃPOµÄ¼¯ºÏ¡£POÖÐÓ¦¸Ã²»°ü
º¬ÈκζÔÊý¾Ý¿âµÄ²Ù×÷¡£
¶þ¡¢VO
:value
objectÖµ¶ÔÏó¡£Í¨³£ÓÃÓÚÒµÎñ²ãÖ®¼äµÄÊý¾Ý´«µÝ£¬ºÍPOÒ»ÑùÒ²Êǽö½ö°üº¬Êý¾ ......
¡¡¡¡XJad2.2£¨JavaÔ´´úÂë·´±àÒ빤¾ß£©
¡¡¡¡Á¢¼´ÏÂÔØ
¡¡¡¡XJadÊÇ»ùÓÚJadºËÐĵÄJavaÔ´³ÌÐò·´±àÒëÈí¼þ£¬ÄÚÖÃJad1.5.8e2¡£
¡¡¡¡XJad¿É´¦Àí¶à¸ö*.classÎļþ£¬¿ÉÒÔ´¦ÀíÎļþ¼ÐÄÚµÄËùÓÐÎļþ£¬ÉõÖÁ¿ÉÒÔ´¦Àí*.jarÎļþ¡£
¡¡¡¡XJad´øÓжàÒ³ÃæÎı¾±à¼Æ÷£¬·´±àÒëÍê³Éºó¿ÉÒÔÖ±½Ó±à¼²é¿´£¬±à¼Æ÷Ö§³ÖjavaÓï·¨µÄ¸ßÁÁÏÔʾ¹¦ÄÜ¡£
¡¡¡¡ ......
²Î¿¼ÍøÉϵÄһЩ×ÊÁÏ£¬×Ô¼ºÑжÁÁËÒ»·¬£¬ÓÃjava¹¹ÔìÁËÒ»¸ö¶þ²æÊ÷À࣬²¢´øÓвâÊÔµÄmain·½·¨£¬ÈçÓв»×ãÇë´ó¼Ò¶à¶àÖ¸½Ì¡£
/**
* ¶þ²æÊ÷¹¹ÔìËã·¨
* ¶þ²æÊ÷¶¨Ò壺ÊǶÈΪ2µÄÓÐÐòÊ÷£¬ËüµÄÌصãÊÇÿ¸ö½ÚµãÖÁ¶àÓÐÁ½¿Ã×ÓÊ÷
* ÎÒÃǵÄËã·¨¾ÍÊǸù¾Ý¶þ²æÊ÷µÄµÝ¹é¶¨Òå¶øÀ´£¬ÏÂÃæÊǶþ²æÊ÷µÄµÝ¹é¶¨Ò壺
* n(n>=0)¸ö½ÚµãµÄÓÐÏÞ¼¯¡£Ëü ......