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

    統計

    FAQ網站

    JSP/Java/Servlet開發工具

    JSP/Java/Servlet技術著名網站

    JSP/Servlet應用程序站點

    優選博客

    主站蜘蛛池模板: 国产综合成人亚洲区| 亚洲宅男精品一区在线观看| 黄色毛片免费观看| 国产区卡一卡二卡三乱码免费| 亚洲一级特黄特黄的大片| 无人影院手机版在线观看免费| 亚洲人成高清在线播放| 免费99精品国产自在现线| 中文字幕亚洲综合小综合在线| 免费电影在线观看网站| 亚洲精品二三区伊人久久| 妞干网免费观看视频| 国产亚洲精彩视频| 亚洲国产一成久久精品国产成人综合 | 亚洲精品无码专区久久同性男| 免费一级特黄特色大片| 曰韩亚洲av人人夜夜澡人人爽| 成人性生交大片免费看好| 亚洲视频小说图片| 最近中文字幕mv免费高清视频7| 在线观看亚洲精品专区| 亚洲婷婷五月综合狠狠爱| 少妇人妻偷人精品免费视频| 亚洲香蕉久久一区二区| 国产免费黄色大片| 四虎影视成人永久免费观看视频 | 新最免费影视大全在线播放| 国产亚洲综合久久系列| 国产一卡2卡3卡4卡无卡免费视频| 亚洲一区二区三区写真| 在线观看亚洲精品福利片| 最刺激黄a大片免费网站| 亚洲国产成人手机在线观看| 中文字幕亚洲日韩无线码| 外国成人网在线观看免费视频| 久久久久久亚洲精品影院| 久久亚洲精品无码观看不卡| 69国产精品视频免费| 高潮毛片无遮挡高清免费视频| 亚洲国产精品无码AAA片| 在线观看视频免费国语|