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

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

?? servletrequestutils.java

?? spring framework 2.5.4源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * Copyright 2002-2007 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.web.bind;

import javax.servlet.ServletRequest;

/**
 * Parameter extraction methods, for an approach distinct from data binding,
 * in which parameters of specific types are required.
 *
 * <p>This approach is very useful for simple submissions, where binding
 * request parameters to a command object would be overkill.
 *
 * @author Juergen Hoeller
 * @author Keith Donald
 * @since 2.0
 */
public abstract class ServletRequestUtils {

	private static final IntParser INT_PARSER = new IntParser();

	private static final LongParser LONG_PARSER = new LongParser();

	private static final FloatParser FLOAT_PARSER = new FloatParser();

	private static final DoubleParser DOUBLE_PARSER = new DoubleParser();

	private static final BooleanParser BOOLEAN_PARSER = new BooleanParser();

	private static final StringParser STRING_PARSER = new StringParser();


	/**
	 * Get an Integer parameter, or <code>null</code> if not present.
	 * Throws an exception if it the parameter value isn't a number.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @return the Integer value, or <code>null</code> if not present
	 * @throws ServletRequestBindingException a subclass of ServletException,
	 * so it doesn't need to be caught
	 */
	public static Integer getIntParameter(ServletRequest request, String name)
			throws ServletRequestBindingException {

		if (request.getParameter(name) == null) {
			return null;
		}
		return new Integer(getRequiredIntParameter(request, name));
	}

	/**
	 * Get an int parameter, with a fallback value. Never throws an exception.
	 * Can pass a distinguished value as default to enable checks of whether it was supplied.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @param defaultVal the default value to use as fallback
	 */
	public static int getIntParameter(ServletRequest request, String name, int defaultVal) {
		if (request.getParameter(name) == null) {
			return defaultVal;
		}
		try {
			return getRequiredIntParameter(request, name);
		}
		catch (ServletRequestBindingException ex) {
			return defaultVal;
		}
	}

	/**
	 * Get an array of int parameters, return an empty array if not found.
	 * @param request current HTTP request
	 * @param name the name of the parameter with multiple possible values
	 */
	public static int[] getIntParameters(ServletRequest request, String name) {
		try {
			return getRequiredIntParameters(request, name);
		}
		catch (ServletRequestBindingException ex) {
			return new int[0];
		}
	}

	/**
	 * Get an int parameter, throwing an exception if it isn't found or isn't a number.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @throws ServletRequestBindingException a subclass of ServletException,
	 * so it doesn't need to be caught
	 */
	public static int getRequiredIntParameter(ServletRequest request, String name)
			throws ServletRequestBindingException {

		return INT_PARSER.parseInt(name, request.getParameter(name));
	}

	/**
	 * Get an array of int parameters, throwing an exception if not found or one is not a number..
	 * @param request current HTTP request
	 * @param name the name of the parameter with multiple possible values
	 * @throws ServletRequestBindingException a subclass of ServletException,
	 * so it doesn't need to be caught
	 */
	public static int[] getRequiredIntParameters(ServletRequest request, String name)
			throws ServletRequestBindingException {

		return INT_PARSER.parseInts(name, request.getParameterValues(name));
	}


	/**
	 * Get a Long parameter, or <code>null</code> if not present.
	 * Throws an exception if it the parameter value isn't a number.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @return the Long value, or <code>null</code> if not present
	 * @throws ServletRequestBindingException a subclass of ServletException,
	 * so it doesn't need to be caught
	 */
	public static Long getLongParameter(ServletRequest request, String name)
			throws ServletRequestBindingException {

		if (request.getParameter(name) == null) {
			return null;
		}
		return new Long(getRequiredLongParameter(request, name));
	}

	/**
	 * Get a long parameter, with a fallback value. Never throws an exception.
	 * Can pass a distinguished value as default to enable checks of whether it was supplied.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @param defaultVal the default value to use as fallback
	 */
	public static long getLongParameter(ServletRequest request, String name, long defaultVal) {
		if (request.getParameter(name) == null) {
			return defaultVal;
		}
		try {
			return getRequiredLongParameter(request, name);
		}
		catch (ServletRequestBindingException ex) {
			return defaultVal;
		}
	}

	/**
	 * Get an array of long parameters, return an empty array if not found.
	 * @param request current HTTP request
	 * @param name the name of the parameter with multiple possible values
	 */
	public static long[] getLongParameters(ServletRequest request, String name) {
		try {
			return getRequiredLongParameters(request, name);
		}
		catch (ServletRequestBindingException ex) {
			return new long[0];
		}
	}

	/**
	 * Get a long parameter, throwing an exception if it isn't found or isn't a number.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @throws ServletRequestBindingException a subclass of ServletException,
	 * so it doesn't need to be caught
	 */
	public static long getRequiredLongParameter(ServletRequest request, String name)
			throws ServletRequestBindingException {

		return LONG_PARSER.parseLong(name, request.getParameter(name));
	}

	/**
	 * Get an array of long parameters, throwing an exception if not found or one is not a number.
	 * @param request current HTTP request
	 * @param name the name of the parameter with multiple possible values
	 * @throws ServletRequestBindingException a subclass of ServletException,
	 * so it doesn't need to be caught
	 */
	public static long[] getRequiredLongParameters(ServletRequest request, String name)
			throws ServletRequestBindingException {

		return LONG_PARSER.parseLongs(name, request.getParameterValues(name));
	}


	/**
	 * Get a Float parameter, or <code>null</code> if not present.
	 * Throws an exception if it the parameter value isn't a number.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @return the Float value, or <code>null</code> if not present
	 * @throws ServletRequestBindingException a subclass of ServletException,
	 * so it doesn't need to be caught
	 */
	public static Float getFloatParameter(ServletRequest request, String name)
			throws ServletRequestBindingException {

		if (request.getParameter(name) == null) {
			return null;
		}
		return new Float(getRequiredFloatParameter(request, name));
	}

	/**
	 * Get a float parameter, with a fallback value. Never throws an exception.
	 * Can pass a distinguished value as default to enable checks of whether it was supplied.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @param defaultVal the default value to use as fallback
	 */
	public static float getFloatParameter(ServletRequest request, String name, float defaultVal) {
		if (request.getParameter(name) == null) {
			return defaultVal;
		}
		try {
			return getRequiredFloatParameter(request, name);
		}
		catch (ServletRequestBindingException ex) {
			return defaultVal;
		}
	}

	/**
	 * Get an array of float parameters, return an empty array if not found.
	 * @param request current HTTP request
	 * @param name the name of the parameter with multiple possible values
	 */
	public static float[] getFloatParameters(ServletRequest request, String name) {
		try {
			return getRequiredFloatParameters(request, name);
		}
		catch (ServletRequestBindingException ex) {
			return new float[0];
		}
	}

	/**
	 * Get a float parameter, throwing an exception if it isn't found or isn't a number.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @throws ServletRequestBindingException a subclass of ServletException,
	 * so it doesn't need to be caught
	 */
	public static float getRequiredFloatParameter(ServletRequest request, String name)
			throws ServletRequestBindingException {

		return FLOAT_PARSER.parseFloat(name, request.getParameter(name));
	}

	/**
	 * Get an array of float parameters, throwing an exception if not found or one is not a number.
	 * @param request current HTTP request
	 * @param name the name of the parameter with multiple possible values
	 * @throws ServletRequestBindingException a subclass of ServletException,
	 * so it doesn't need to be caught
	 */
	public static float[] getRequiredFloatParameters(ServletRequest request, String name)
			throws ServletRequestBindingException {

		return FLOAT_PARSER.parseFloats(name, request.getParameterValues(name));
	}


	/**
	 * Get a Double parameter, or <code>null</code> if not present.
	 * Throws an exception if it the parameter value isn't a number.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @return the Double value, or <code>null</code> if not present
	 * @throws ServletRequestBindingException a subclass of ServletException,
	 * so it doesn't need to be caught
	 */
	public static Double getDoubleParameter(ServletRequest request, String name)
			throws ServletRequestBindingException {

		if (request.getParameter(name) == null) {
			return null;
		}
		return new Double(getRequiredDoubleParameter(request, name));
	}

	/**
	 * Get a double parameter, with a fallback value. Never throws an exception.
	 * Can pass a distinguished value as default to enable checks of whether it was supplied.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @param defaultVal the default value to use as fallback
	 */
	public static double getDoubleParameter(ServletRequest request, String name, double defaultVal) {
		if (request.getParameter(name) == null) {
			return defaultVal;
		}
		try {
			return getRequiredDoubleParameter(request, name);
		}
		catch (ServletRequestBindingException ex) {
			return defaultVal;
		}
	}

	/**
	 * Get an array of double parameters, return an empty array if not found.
	 * @param request current HTTP request
	 * @param name the name of the parameter with multiple possible values
	 */
	public static double[] getDoubleParameters(ServletRequest request, String name) {
		try {
			return getRequiredDoubleParameters(request, name);
		}
		catch (ServletRequestBindingException ex) {
			return new double[0];
		}
	}

	/**
	 * Get a double parameter, throwing an exception if it isn't found or isn't a number.
	 * @param request current HTTP request
	 * @param name the name of the parameter
	 * @throws ServletRequestBindingException a subclass of ServletException,
	 * so it doesn't need to be caught
	 */
	public static double getRequiredDoubleParameter(ServletRequest request, String name)
			throws ServletRequestBindingException {

		return DOUBLE_PARSER.parseDouble(name, request.getParameter(name));
	}

	/**
	 * Get an array of double parameters, throwing an exception if not found or one is not a number.
	 * @param request current HTTP request
	 * @param name the name of the parameter with multiple possible values
	 * @throws ServletRequestBindingException a subclass of ServletException,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美视频在线观看| 日本不卡中文字幕| 欧美无砖专区一中文字| 秋霞午夜av一区二区三区| 日韩精品一区二区三区四区| 97se亚洲国产综合自在线观| 韩国欧美一区二区| 国产精品一二三| 色欧美日韩亚洲| 尤物av一区二区| 亚洲激情图片一区| 一卡二卡三卡日韩欧美| 亚洲猫色日本管| 一区二区三区欧美激情| 亚洲国产欧美一区二区三区丁香婷| 亚洲视频一区二区在线| 亚洲欧美激情小说另类| 一区二区在线看| 日韩影院在线观看| 亚洲一区二区三区四区在线免费观看| 亚洲成av人片在www色猫咪| 日本一不卡视频| 国产九色sp调教91| 99re这里只有精品6| 欧美日韩中文精品| 精品久久人人做人人爱| 国产精品国产三级国产三级人妇| 自拍偷在线精品自拍偷无码专区 | 久久久精品黄色| 国产蜜臀97一区二区三区 | 国产在线麻豆精品观看| 国产91丝袜在线播放0| 91免费精品国自产拍在线不卡| 欧美日韩一区二区不卡| 日韩一卡二卡三卡| 国产精品免费视频观看| 亚洲一区二区三区四区在线免费观看| 日韩av电影免费观看高清完整版 | 久久久99精品免费观看| 亚洲色图在线播放| 麻豆专区一区二区三区四区五区| 成人午夜视频免费看| 欧美少妇bbb| 国产日韩精品视频一区| 丰满少妇久久久久久久| 在线观看亚洲a| 久久婷婷国产综合精品青草| 亚洲欧美国产77777| 久久精品国产一区二区三区免费看| 成人国产精品免费观看视频| 欧美国产亚洲另类动漫| 悠悠色在线精品| 久久精品72免费观看| 成人av网址在线| 久久精品夜夜夜夜久久| 亚洲成a天堂v人片| av成人老司机| 欧美一级日韩不卡播放免费| 国产精品久久久久一区二区三区共| 夜夜亚洲天天久久| 成人黄色小视频在线观看| 欧美日韩视频在线观看一区二区三区 | 一本大道av一区二区在线播放| 亚洲国产精品成人综合| 日韩不卡一二三区| 在线播放日韩导航| 国产传媒欧美日韩成人| 午夜一区二区三区在线观看| 蜜臀va亚洲va欧美va天堂| 狠狠色伊人亚洲综合成人| 色欧美88888久久久久久影院| 日韩一级视频免费观看在线| 日韩中文字幕亚洲一区二区va在线| 久久青草欧美一区二区三区| 精品久久久久久久久久久久久久久| 国产日韩亚洲欧美综合| 亚洲国产另类av| 亚洲一区二区视频在线| 精品国产乱子伦一区| 久久国产福利国产秒拍| 久久久精品综合| 亚洲人成网站影音先锋播放| 亚洲国产你懂的| 91丨porny丨首页| 国产欧美日产一区| 国产永久精品大片wwwapp| 日韩欧美国产系列| 婷婷丁香久久五月婷婷| 91福利精品视频| 一区二区三区日韩| 91一区二区在线观看| 综合色天天鬼久久鬼色| 成人国产精品免费观看动漫| 欧美激情综合五月色丁香小说| 国产专区综合网| 久久综合久色欧美综合狠狠| 免费观看在线综合| 欧美一区永久视频免费观看| 三级成人在线视频| 欧美人伦禁忌dvd放荡欲情| 亚洲一区二区三区四区五区中文| 色婷婷综合久色| 亚洲一二三级电影| 欧美色涩在线第一页| 亚洲va天堂va国产va久| 4438x亚洲最大成人网| 婷婷久久综合九色国产成人 | 成人看片黄a免费看在线| 国产亚洲视频系列| 成人综合在线网站| 国产精品初高中害羞小美女文| 成人福利视频在线看| 亚洲欧洲精品一区二区三区不卡| av电影在线观看一区| 一区二区三区久久| 欧美久久久久久久久中文字幕| 日本不卡在线视频| 欧美精品一区二区三区四区| 国产suv精品一区二区6| 中文字幕日本乱码精品影院| 91美女在线观看| 午夜视频一区在线观看| 精品久久免费看| 成人av在线播放网址| 又紧又大又爽精品一区二区| 这里只有精品免费| 国产一区不卡视频| 中文字幕一区二区三中文字幕| 色婷婷综合久久久中文字幕| 日韩中文字幕麻豆| 国产日韩高清在线| 91黄色在线观看| 久草精品在线观看| 国产精品欧美一级免费| 91福利视频久久久久| 久久99精品国产91久久来源| 国产精品妹子av| 欧美日韩亚洲高清一区二区| 精品一区二区日韩| 亚洲欧美国产高清| 欧美成人三级在线| 成人av资源下载| 日本不卡123| 欧美中文字幕一区二区三区| 精品日韩99亚洲| 99久久99久久久精品齐齐| 亚洲综合免费观看高清完整版在线| 日韩欧美中文字幕制服| 99久久亚洲一区二区三区青草| 天天av天天翘天天综合网 | 亚洲激情五月婷婷| 日韩精品一区二区三区视频在线观看 | 成人小视频免费在线观看| 国产在线麻豆精品观看| 91在线你懂得| 色综合久久中文综合久久牛| 日本韩国欧美在线| 国产欧美日本一区视频| 亚洲国产aⅴ成人精品无吗| 亚洲一级二级三级| 美日韩一区二区| 亚洲国产日韩综合久久精品| 日韩电影免费在线观看网站| a亚洲天堂av| 欧美日韩另类一区| 中文字幕视频一区| 久久99热狠狠色一区二区| 欧美日韩一区中文字幕| 欧美国产一区视频在线观看| 精品一区二区三区在线播放| 7777精品伊人久久久大香线蕉经典版下载 | 99视频国产精品| 国产精品美女久久久久aⅴ国产馆| 国产乱淫av一区二区三区| 日韩一区二区在线看| 石原莉奈在线亚洲三区| 欧美日韩1区2区| 狠狠狠色丁香婷婷综合激情 | 黄色日韩三级电影| 久久久精品tv| 成人网在线免费视频| 亚洲欧美一区二区三区孕妇| 欧美午夜精品久久久| 日韩国产高清在线| 日韩亚洲欧美高清| 国产精品一区二区男女羞羞无遮挡| 精品国产不卡一区二区三区| 国产成人h网站| 欧美白人最猛性xxxxx69交| 国产精品一二一区| 亚洲欧洲精品天堂一级| 制服视频三区第一页精品| 国产高清不卡一区| 一区二区三区欧美久久| 欧美精品一区男女天堂| 97se亚洲国产综合自在线不卡| 性久久久久久久久| 国产精品系列在线| 欧美va亚洲va在线观看蝴蝶网| 成人丝袜18视频在线观看|