亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? genericparamutil.java

?? 解觖java技術中后臺無法上傳數給的情況
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * $Header: /cvsroot/mvnforum/myvietnam/src/net/myvietnam/mvncore/util/GenericParamUtil.java,v 1.6.2.1 2006/07/10 12:55:29 phuongpdd Exp $
 * $Author: phuongpdd $
 * $Revision: 1.6.2.1 $
 * $Date: 2006/07/10 12:55:29 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2006 by MyVietnam.net
 *
 * All copyright notices regarding MyVietnam and MyVietnam CoreLib
 * MUST remain intact in the scripts and source code.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * Correspondence and Marketing Questions can be sent to:
 * info at MyVietnam net
 *
 * @author: Minh Nguyen  
 * @author: Mai  Nguyen  
 */
package net.myvietnam.mvncore.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Locale;

import javax.servlet.http.HttpSession;

import net.myvietnam.mvncore.MVNCoreResourceBundle;
import net.myvietnam.mvncore.exception.BadInputException;
import net.myvietnam.mvncore.filter.DisableHtmlTagFilter;
import net.myvietnam.mvncore.web.GenericRequest;

public final class GenericParamUtil {

    private GenericParamUtil() { // prevent instantiation
    }

    //private static String contextPath = (new ParamOptions()).contextPath;
    //private static String serverPath = (new ParamOptions()).serverPath;//@todo combine 2 line to a static block

    private static DateFormat dateFormat = new SimpleDateFormat ("dd/MM/yyyy");

    public static String getParameter(GenericRequest request, String param) {

        String ret = request.getParameter(param);
        if (ret == null) ret = "";
        return ret.trim();
    }

    public static String getParameterFilter(GenericRequest request, String param) {
        return DisableHtmlTagFilter.filter(getParameter(request, param));
    }
    
    //獲取表單,URL參數,
    public static String getParameter(GenericRequest request, String param, boolean checkEmpty)
        throws BadInputException {    	
        String ret = request.getParameter(param);
        if (ret == null) ret = "";
        ret = ret.trim();        
        if ( checkEmpty && (ret.length() == 0) ) {
            Locale locale = I18nUtil.getLocaleInRequest(request);
            String localizedMessage = MVNCoreResourceBundle.getString(locale, "mvncore.exception.BadInputException.not_allow_to_be_empty", new Object[] {DisableHtmlTagFilter.filter(param)});
            throw new BadInputException(localizedMessage);
        }
        return ret;
    }

    public static String getParameterFilter(GenericRequest request, String param, boolean checkEmpty)
        throws BadInputException {
        return DisableHtmlTagFilter.filter(getParameter(request, param, checkEmpty));
    }

    /** @todo review this method */
    public static String getParameterSafe(GenericRequest request, String param, boolean checkEmpty)
        throws BadInputException {

        String ret = getParameter(request, param, checkEmpty);
        if ( (ret.indexOf('<') != -1) ||
             (ret.indexOf('>') != -1)) {
            Locale locale = I18nUtil.getLocaleInRequest(request);
            String localizedMessage = MVNCoreResourceBundle.getString(locale, "mvncore.exception.BadInputException.parameter_safe", new Object[] {DisableHtmlTagFilter.filter(param)});
            throw new BadInputException(localizedMessage);
        }
        return ret;
    }

    public static int getParameterInt(GenericRequest request, String param)
        throws BadInputException {

        String inputStr = getParameter(request, param, true);
        int ret;
        try {
            ret = Integer.parseInt(inputStr);
        } catch (NumberFormatException e) {
            Locale locale = I18nUtil.getLocaleInRequest(request);
            String localizedMessage = MVNCoreResourceBundle.getString(locale, "mvncore.exception.BadInputException.cannot_parse", new Object[] {DisableHtmlTagFilter.filter(param), "int"});
            throw new BadInputException(localizedMessage);
        }
        return ret;
    }

    public static int getParameterUnsignedInt(GenericRequest request, String param)
        throws BadInputException {

        int retValue = getParameterInt(request, param);
        if (retValue < 0) {
            Locale locale = I18nUtil.getLocaleInRequest(request);
            String localizedMessage = MVNCoreResourceBundle.getString(locale, "mvncore.exception.BadInputException.must_be_unsigned_value", new Object[] {DisableHtmlTagFilter.filter(param)});
            throw new BadInputException(localizedMessage);
        }
        return retValue;
    }

    public static int getParameterInt(GenericRequest request, String param, int defaultValue)
        throws BadInputException {

        String inputStr = getParameter(request, param, false);
        if (inputStr.length() == 0) {
            return defaultValue;
        }
        int ret;
        try {
            ret = Integer.parseInt(inputStr);
        } catch (NumberFormatException e) {
            Locale locale = I18nUtil.getLocaleInRequest(request);
            String localizedMessage = MVNCoreResourceBundle.getString(locale, "mvncore.exception.BadInputException.cannot_parse", new Object[] {DisableHtmlTagFilter.filter(param), "int"});
            throw new BadInputException(localizedMessage);
        }
        return ret;
    }

    public static int getParameterUnsignedInt(GenericRequest request, String param, int defaultValue)
        throws BadInputException {

        int retValue = getParameterInt(request, param, defaultValue);
        if (retValue < 0) {
            Locale locale = I18nUtil.getLocaleInRequest(request);
            String localizedMessage = MVNCoreResourceBundle.getString(locale, "mvncore.exception.BadInputException.must_be_unsigned_value", new Object[] {DisableHtmlTagFilter.filter(param)});
            throw new BadInputException(localizedMessage);
        }
        return retValue;
    }

    public static long getParameterLong(GenericRequest request, String param)
        throws BadInputException {

        String inputStr = getParameter(request, param, true);
        long ret;
        try {
            ret = Long.parseLong(inputStr);
        } catch (NumberFormatException e) {
            Locale locale = I18nUtil.getLocaleInRequest(request);
            String localizedMessage = MVNCoreResourceBundle.getString(locale, "mvncore.exception.BadInputException.cannot_parse", new Object[] {DisableHtmlTagFilter.filter(param), "long"});
            throw new BadInputException(localizedMessage);
        }
        return ret;
    }

    public static long getParameterLong(GenericRequest request, String param, long defaultValue)
        throws BadInputException {

        String inputStr = getParameter(request, param, false);
        if (inputStr.length() == 0) {
            return defaultValue;
        }

        long ret;
        try {
            ret = Long.parseLong(inputStr);
        } catch (NumberFormatException e) {
            Locale locale = I18nUtil.getLocaleInRequest(request);
            String localizedMessage = MVNCoreResourceBundle.getString(locale, "mvncore.exception.BadInputException.cannot_parse", new Object[] {DisableHtmlTagFilter.filter(param), "long"});
            throw new BadInputException(localizedMessage);
        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久国产精品麻豆| 亚洲成av人片在线观看| 国产欧美一区二区在线观看| 蜜臀av性久久久久蜜臀av麻豆| 色哟哟精品一区| 亚洲永久免费视频| 日韩一级完整毛片| 国产成人丝袜美腿| 中文字幕在线观看不卡| 亚洲一二三四在线| 8v天堂国产在线一区二区| 国产精品一二三四| 一区二区三区电影在线播| 精品久久久久一区| 91丨porny丨首页| 另类小说综合欧美亚洲| 亚洲三级小视频| 日韩一级片网址| 91丨porny丨中文| 精品一区二区在线观看| 亚洲欧美成aⅴ人在线观看| 在线播放日韩导航| 99精品欧美一区二区蜜桃免费| 日韩中文欧美在线| 亚洲天堂精品在线观看| 亚洲欧美电影一区二区| 国产精品一区二区三区99| 亚洲六月丁香色婷婷综合久久| 精品99999| 91精品国产综合久久精品| av激情成人网| 国内精品伊人久久久久av影院| 亚洲一区二区三区影院| 亚洲欧洲日韩在线| 国产欧美日韩在线观看| 日韩一区二区三区观看| 欧美日韩成人综合| 色综合欧美在线视频区| 成人午夜在线播放| 国产成人在线视频播放| 黄色精品一二区| 精品一区二区免费看| 另类中文字幕网| 国产在线精品免费| 久久99精品一区二区三区三区| 日本成人在线看| 久久精品国产精品亚洲红杏| 久久99精品久久久| 免费在线一区观看| 久久电影网电视剧免费观看| 国产自产2019最新不卡| 国产精品中文字幕日韩精品| 麻豆久久一区二区| 1024国产精品| 亚洲天堂2016| 亚洲成国产人片在线观看| 日韩成人伦理电影在线观看| 国产一区二区三区视频在线播放| 国产91在线看| 91丨九色丨蝌蚪丨老版| 色婷婷香蕉在线一区二区| 欧美性生活大片视频| 欧美三级视频在线观看| 精品少妇一区二区三区在线播放| 国产性天天综合网| 亚洲欧洲三级电影| 亚洲风情在线资源站| 日韩av中文字幕一区二区三区| 看电视剧不卡顿的网站| 国产经典欧美精品| 国产91精品在线观看| 欧美日韩综合在线免费观看| 日韩精品一区二区三区中文不卡 | 精品粉嫩aⅴ一区二区三区四区| 久久亚洲精华国产精华液| 自拍偷自拍亚洲精品播放| 亚洲二区在线观看| 国产91露脸合集magnet| 7799精品视频| 国产精品美女久久久久久| 色伊人久久综合中文字幕| 精品在线观看视频| 欧美少妇xxx| 亚洲国产经典视频| 免费国产亚洲视频| 在线亚洲高清视频| 中文字幕 久热精品 视频在线 | 国产精品久久久久久久久免费丝袜| 五月激情丁香一区二区三区| 成人中文字幕合集| 日韩精品中文字幕一区| 亚洲综合在线电影| av高清久久久| 国产精品美女久久久久久久久久久| 免费不卡在线观看| 91精品国产色综合久久不卡蜜臀 | 亚洲日本va在线观看| 久久国产尿小便嘘嘘| 91精品国产综合久久久蜜臀图片| 亚洲欧美另类图片小说| 99久久精品免费| 久久久三级国产网站| 精品一区二区三区在线观看 | 日韩精品一区二区三区中文不卡 | 精品久久久久久久久久久院品网| 亚洲五月六月丁香激情| 色综合天天综合网国产成人综合天 | 蜜臀精品一区二区三区在线观看| 欧美久久久一区| 亚洲精品在线一区二区| 精品亚洲aⅴ乱码一区二区三区| 日韩欧美国产一区二区在线播放 | 久久免费视频一区| 狠狠色狠狠色综合系列| 久久久国产精华| 国产精品一区二区91| 精品国产乱码久久久久久免费| 久久av老司机精品网站导航| 久久久久88色偷偷免费| 欧美电视剧免费观看| 韩国成人在线视频| 国产精品视频一二三| 欧美性一二三区| 青青草伊人久久| 久久久久久久久一| 亚洲成av人片一区二区梦乃| 亚洲制服欧美中文字幕中文字幕| 欧美高清一级片在线| 91麻豆精品国产91久久久使用方法 | 欧美中文字幕亚洲一区二区va在线| 欧美一区二区三区视频在线 | 欧美一区二区播放| 亚洲精品一区二区三区香蕉| 色婷婷av久久久久久久| 国产一区二区在线看| 亚洲人吸女人奶水| 日韩精品一区在线| 一本久久a久久精品亚洲| 日本一区二区在线不卡| 91福利国产精品| 黑人巨大精品欧美黑白配亚洲| 亚洲伦理在线精品| 久久久久国产精品厨房| 7777精品伊人久久久大香线蕉 | proumb性欧美在线观看| 奇米精品一区二区三区四区| 亚洲蜜臀av乱码久久精品| 精品99一区二区三区| 麻豆国产一区二区| 亚洲自拍偷拍欧美| 最新不卡av在线| 国产日韩精品久久久| 精品久久久久一区| 欧美一区午夜精品| 在线影院国内精品| 97国产一区二区| 成人美女视频在线看| 久久99久久久久| 婷婷六月综合亚洲| 亚洲自拍都市欧美小说| 亚洲人快播电影网| 欧美一二区视频| 欧美日韩在线亚洲一区蜜芽| 久久九九全国免费| 色噜噜狠狠一区二区三区果冻| 丰满岳乱妇一区二区三区| 国产一区二区三区美女| 国产一二精品视频| 日韩国产一二三区| 日本伊人色综合网| 日本欧美一区二区三区乱码| 日韩国产在线观看| 另类调教123区| 国产精品全国免费观看高清| 国产午夜精品美女毛片视频| 久久精品一级爱片| 欧美国产一区二区在线观看| 国产精品网曝门| 亚洲色欲色欲www| 亚洲综合激情小说| 日本视频中文字幕一区二区三区| 麻豆国产91在线播放| 国产精品18久久久久久久网站| 成人黄色小视频在线观看| 欧美在线观看一区| 日韩视频一区二区三区在线播放| 69堂国产成人免费视频| gogo大胆日本视频一区| 91免费视频网址| 欧美日本一区二区| 久久久久99精品一区| 一区二区三区自拍| 美女视频黄久久| caoporn国产精品| 欧美一区二视频| 中文字幕av一区二区三区高| 亚洲国产精品视频| 国产精品一二三在| 欧美性感一区二区三区| 久久精品视频在线看|