<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    ???? Some times we need fill forms and we also need chage the type. just think,if you hava a table and there are three Int types, four string type and other types .if you want to change their types use the type-translate(like String(request.getParameter("userName"))). just think, how hard the work is!?
    ???? And what should we do now? Must i use type-translate? if we do like this the work is so hard to do.Yes! maybe you can speak it out "JavaBean"!
    ???? let me see the model:
    ???? BeanUtilities.java
    code:
    ???? package skyey.snow.*;
    ???? import? java.util.*;
    ???? import? javax.servlet.http.*;
    ???? import? org.apache.commons.beanutils.BeanUtilities;

    /*Some utilities to populate beand, usually based on incoming request parameters. Requires three packages
    *from the Apache Commons libarary: beanutils,collection and logging.To obtain these packages,see
    *http://jakarta.apache.org/commons/.Also,the book's source code archive (see http://www.coreservlets.com/)
    *contains links to all URLs mentioned in the book,including to the specific sections of the Jakarta Commons package.
    *<p>
    *Note that this class in the skeyey.snow.beans package,so must be installed in ..../package/beans/.
    */

    public class BeanUtilities
    {
    /** Examines all of the request parameters to see if any catch a bean property(i.i.,a setXXX method)in the project.
    *If so,the request parameter values is passed to that method.If the method expects an int,Integer,double,Double,or any
    *of the other primitive or wrapper types,parsing and conversion is done automatically.If the request parameter value is *malformed(cannot be converted into the expected type),numeric properties are assigned zero and boolean properties
    *are assigned false:no exception is thrown.
    */
    ?public static void populateBean(Object formBean,HttpServletRequest request)
    ?? {
    ????? populateBean(formBean,request.getParameterMap());
    /**Populates a bean beased on a Map: Map keys are the bean property names;Map values are the bean property values.
    *Type conversion is performed automatically as described above.
    */
    ?? }
    public static void populateBean(Object bean,Map propertyMap)
    ??{
    ??? ?try
    ?????? {?
    ????????? BeanUtilities.populate(bean,propertyMap);
    ????????}
    ???? catch(Exception e)
    ??????? {// Empty catch.The two possible exceptions are java.lang.IllegalAccessException and java.lang.reflect.
    ???????? //InvocationTargetExcepton.In both cases,just skip the bean operation.
    ???????? }
    ? }
    }
    posted on 2006-03-23 18:29 飛揚(yáng) 閱讀(298) 評(píng)論(0)  編輯  收藏 所屬分類: Java

    統(tǒng)計(jì)

    FAQ網(wǎng)站

    JSP/Java/Servlet開發(fā)工具

    JSP/Java/Servlet技術(shù)著名網(wǎng)站

    JSP/Servlet應(yīng)用程序站點(diǎn)

    優(yōu)選博客

    主站蜘蛛池模板: 亚洲无mate20pro麻豆| 日本一线a视频免费观看| 亚洲av永久无码精品天堂久久| 国产卡二卡三卡四卡免费网址| 国产成人精品亚洲一区| 亚洲人成人一区二区三区| 麻花传媒剧在线mv免费观看| 激情无码亚洲一区二区三区| 亚洲av无码国产精品色午夜字幕| 成人毛片免费观看| 中文字幕免费在线看| 亚洲国产精品激情在线观看| 久久青草免费91线频观看站街| 亚洲国产精品成人午夜在线观看| 亚洲人精品午夜射精日韩 | 久久亚洲精品11p| 亚洲成在人线av| 日韩高清在线高清免费| 国产精品免费无遮挡无码永久视频| 亚洲私人无码综合久久网| 亚洲高清专区日韩精品| 国产hs免费高清在线观看| 免费v片在线观看视频网站| 一区二区三区免费视频观看| 亚洲精品免费网站| 亚洲AV永久无码精品一百度影院| 日本一道高清不卡免费| 国产成人精品免费视频动漫| WWW免费视频在线观看播放| 亚洲色欲久久久综合网东京热| 好男人看视频免费2019中文 | 国产v片免费播放| 91嫩草免费国产永久入口| 岛国岛国免费V片在线观看| 欧美亚洲国产SUV| 亚洲综合av一区二区三区| 久久亚洲精品人成综合网| 亚洲线精品一区二区三区影音先锋| 黑人粗长大战亚洲女2021国产精品成人免费视频| 自拍日韩亚洲一区在线| 日韩亚洲Av人人夜夜澡人人爽|