<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 飛揚 閱讀(298) 評論(0)  編輯  收藏 所屬分類: Java

    統計

    FAQ網站

    JSP/Java/Servlet開發工具

    JSP/Java/Servlet技術著名網站

    JSP/Servlet應用程序站點

    優選博客

    主站蜘蛛池模板: 国产黄色免费网站| 91精品国产免费久久国语蜜臀| 最近免费中文字幕视频高清在线看| 亚洲AV成人片色在线观看| 你懂的免费在线观看| 亚洲AV无码第一区二区三区| 91成人免费福利网站在线| 亚洲AV无码成人精品区天堂| 久久国产精品2020免费m3u8| 亚洲欧洲日韩不卡| 19禁啪啪无遮挡免费网站| 亚洲特级aaaaaa毛片| 久久不见久久见免费影院| 亚洲欧美日韩久久精品| 国产精品极品美女免费观看| 老司机午夜精品视频在线观看免费| 亚洲AV无码一区二区三区在线观看| 72pao国产成视频永久免费| 亚洲中文字幕无码一久久区| 国产白丝无码免费视频| 亚洲噜噜噜噜噜影院在线播放| 免费电影在线观看网站| 色窝窝亚洲av网| 激情综合色五月丁香六月亚洲| 久久青草免费91线频观看站街| 亚洲精品视频在线播放| 免费网站看v片在线香蕉| 无忧传媒视频免费观看入口| 亚洲精品乱码久久久久久中文字幕 | 国产成人一区二区三区视频免费| 99人中文字幕亚洲区| 久久久久国产精品免费免费搜索 | 国产A∨免费精品视频| 亚洲免费在线视频| 午夜网站免费版在线观看| h视频在线免费观看| 精品亚洲麻豆1区2区3区| 日韩在线看片免费人成视频播放| 亚洲一级片免费看| 亚洲av永久综合在线观看尤物| 无码欧精品亚洲日韩一区夜夜嗨|