<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) 閱讀(290) 評論(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)選博客

    主站蜘蛛池模板: 亚洲成人动漫在线观看| 亚洲AV无码一区二区三区系列| 亚洲中文字幕久在线| 18禁美女黄网站色大片免费观看 | 91亚洲一区二区在线观看不卡| 99久久免费国产特黄| 亚洲色成人网站WWW永久| 好吊色永久免费视频大全| 亚洲中文字幕无码永久在线 | 久久亚洲国产精品123区| 一本大道一卡二大卡三卡免费| 亚洲中文字幕无码久久综合网| 国产免费无码一区二区| 久久亚洲精品国产精品黑人| 日韩在线永久免费播放| 亚洲中文字幕无码av在线| 国内自产少妇自拍区免费| 看全免费的一级毛片| 亚洲精品乱码久久久久久 | 日韩一区二区a片免费观看| 亚洲日韩国产AV无码无码精品| 免费人成网站7777视频| 国产精品1024在线永久免费 | 久久亚洲精品成人综合| 日韩欧毛片免费视频| 无码天堂亚洲国产AV| 中文字幕亚洲无线码| 四虎精品视频在线永久免费观看| 日韩亚洲国产综合高清| 免费大黄网站在线观看| 三级黄色片免费看| 亚洲欧洲日产国码二区首页 | 日韩内射激情视频在线播放免费 | 老湿机一区午夜精品免费福利 | 成熟女人特级毛片www免费| 九九综合VA免费看| 亚洲小说区图片区| 四虎国产精品免费视| 免费成人在线电影| 亚洲国产精品无码久久98| 亚洲色大成网站WWW久久九九 |