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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jasperreportsmultiformatview.java

?? spring framework 2.5.4源代碼
?? JAVA
字號(hào):
/*
 * Copyright 2002-2008 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.servlet.view.jasperreports;

import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import javax.servlet.http.HttpServletResponse;

import net.sf.jasperreports.engine.JasperPrint;

import org.springframework.beans.BeanUtils;
import org.springframework.context.ApplicationContextException;
import org.springframework.util.ClassUtils;

/**
 * Jasper Reports view class that allows for the actual rendering format to be
 * specified at runtime using a parameter contained in the model.
 *
 * <p>This view works on the concept of a format key and a mapping key.
 * The format key is used to pass the mapping key from your
 * <code>Controller</code> to Spring through as part of the model and the
 * mapping key is used to map a logical format to an actual JasperReports
 * view class. For example you might add the following code to your
 * <code>Controller</code>:
 *
 * <pre>
 * Map model = new HashMap();
 * model.put("format", "pdf");</pre>
 *
 * Here <code>format</code> is the format key and <code>pdf</code> is
 * the mapping key. When rendering a report, this class looks for a
 * model parameter under the format key, which by default is
 * <code>format</code>. It then uses the value of this parameter to lookup
 * the actual <code>View</code> class to use. The default mappings for this
 * lookup are:
 *
 * <p><ul>
 * <li><code>csv</code> - <code>JasperReportsCsvView</code></li>
 * <li><code>html</code> - <code>JasperReportsHtmlView</code></li>
 * <li><code>pdf</code> - <code>JasperReportsPdfView</code></li>
 * <li><code>xls</code> - <code>JasperReportsXlsView</code></li>
 * </ul>
 *
 * <p>The format key can be changed using the <code>formatKey</code>
 * property and the mapping key to view class mappings can be changed using the
 * <code>formatMappings</code> property.
 *
 * @author Rob Harrop
 * @author Juergen Hoeller
 * @since 1.1.5
 * @see #setFormatKey
 * @see #setFormatMappings
 */
public class JasperReportsMultiFormatView extends AbstractJasperReportsView {

	/**
	 * Default value used for format key: "format"
	 */
	public static final String DEFAULT_FORMAT_KEY = "format";


	/**
	 * The key of the model parameter that holds the format key.
	 */
	private String formatKey = DEFAULT_FORMAT_KEY;

	/**
	 * Stores the format mappings, with the format discriminator
	 * as key and the corresponding view class as value.
	 */
	private Map formatMappings;

	/**
	 * Stores the mappings of mapping keys to Content-Disposition header values.
	 */
	private Properties contentDispositionMappings;


  /**
	 * Creates a new <code>JasperReportsMultiFormatView</code> instance
	 * with a default set of mappings.
	 */
	public JasperReportsMultiFormatView() {
		this.formatMappings = new HashMap(4);
		this.formatMappings.put("csv", JasperReportsCsvView.class);
		this.formatMappings.put("html", JasperReportsHtmlView.class);
		this.formatMappings.put("pdf", JasperReportsPdfView.class);
		this.formatMappings.put("xls", JasperReportsXlsView.class);
	}

	/**
	 * Set the key of the model parameter that holds the format discriminator.
	 * Default is "format".
	 */
	public void setFormatKey(String formatKey) {
		this.formatKey = formatKey;
	}

	/**
	 * Set the mappings of format discriminators to view class names.
	 * The default mappings are:
	 * <p><ul>
	 * <li><code>csv</code> - <code>JasperReportsCsvView</code></li>
	 * <li><code>html</code> - <code>JasperReportsHtmlView</code></li>
	 * <li><code>pdf</code> - <code>JasperReportsPdfView</code></li>
	 * <li><code>xls</code> - <code>JasperReportsXlsView</code></li>
	 * </ul>
	 */
	public void setFormatMappings(Properties mappingsWithClassNames) {
		if (mappingsWithClassNames == null || mappingsWithClassNames.isEmpty()) {
			throw new IllegalArgumentException("formatMappings must not be empty");
		}

		this.formatMappings = new HashMap(mappingsWithClassNames.size());
		for (Enumeration discriminators = mappingsWithClassNames.propertyNames(); discriminators.hasMoreElements();) {
			String discriminator = (String) discriminators.nextElement();
			String className = mappingsWithClassNames.getProperty(discriminator);
			try {
				if (logger.isDebugEnabled()) {
					logger.debug("Mapped view class [" + className + "] to mapping key [" + discriminator + "]");
				}
				this.formatMappings.put(discriminator, ClassUtils.forName(className));
			}
			catch (ClassNotFoundException ex) {
				throw new ApplicationContextException(
						"Class [" + className + "] mapped to format [" + discriminator + "] cannot be found", ex);
			}
		}
	}

	/**
	 * Set the mappings of <code>Content-Disposition</code> header values to
	 * mapping keys. If specified, Spring will look at these mappings to determine
	 * the value of the <code>Content-Disposition</code> header for a given
	 * format mapping.
	 */
	public void setContentDispositionMappings(Properties mappings) {
		this.contentDispositionMappings = mappings;
	}

	/**
	 * Return the mappings of <code>Content-Disposition</code> header values to
	 * mapping keys. Mainly available for configuration through property paths
	 * that specify individual keys.
	 */
	public Properties getContentDispositionMappings() {
		if (this.contentDispositionMappings == null) {
			this.contentDispositionMappings = new Properties();
		}
		return this.contentDispositionMappings;
	}


	protected boolean generatesDownloadContent() {
		return true;
	}

	/**
	 * Locates the format key in the model using the configured discriminator key and uses this
	 * key to lookup the appropriate view class from the mappings. The rendering of the
	 * report is then delegated to an instance of that view class.
	 */
	protected void renderReport(JasperPrint populatedReport, Map model, HttpServletResponse response)
			throws Exception {

		String format = (String) model.get(this.formatKey);
		if (format == null) {
			throw new IllegalArgumentException("No format format found in model");
		}

		if (logger.isDebugEnabled()) {
			logger.debug("Rendering report using format mapping key [" + format + "]");
		}

		Class viewClass = (Class) this.formatMappings.get(format);
		if (viewClass == null) {
			throw new IllegalArgumentException("Format discriminator [" + format + "] is not a configured mapping");
		}

		if (logger.isDebugEnabled()) {
			logger.debug("Rendering report using view class [" + viewClass.getName() + "]");
		}

		AbstractJasperReportsView view = (AbstractJasperReportsView) BeanUtils.instantiateClass(viewClass);

		// Copy appropriate properties across.
		view.setExporterParameters(getExporterParameters());

		// Can skip most initialization since all relevant URL processing
		// has been done - just need to convert parameters on the sub view.
		view.convertExporterParameters();

		// Prepare response and render report.
		populateContentDispositionIfNecessary(response, format);
		view.renderReport(populatedReport, model, response);
	}

	/**
	 * Adds/overwrites the <code>Content-Disposition</code> header value with the format-specific
	 * value if the mappings have been specified and a valid one exists for the given format.
	 * @param response the <code>HttpServletResponse</code> to set the header in
	 * @param format the format key of the mapping
	 * @see #setContentDispositionMappings
	 */
	private void populateContentDispositionIfNecessary(HttpServletResponse response, String format) {
		if (this.contentDispositionMappings != null) {
			String header = this.contentDispositionMappings.getProperty(format);
			if (header != null) {
				if (logger.isDebugEnabled()) {
					logger.debug("Setting Content-Disposition header to: [" + header + "]");
				}
				response.setHeader(HEADER_CONTENT_DISPOSITION, header);
			}
		}
	}

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
男男视频亚洲欧美| 色综合久久久久久久久久久| 色综合久久久久久久久久久| 不卡的电视剧免费网站有什么| 日韩欧美在线1卡| 精品99久久久久久| 亚洲午夜精品17c| 亚洲香蕉伊在人在线观| 美女精品自拍一二三四| 成人伦理片在线| 欧美日韩免费一区二区三区 | 欧美国产精品中文字幕| 国产精品久久久久久福利一牛影视 | 成人动漫一区二区| 欧美美女一区二区三区| 成熟亚洲日本毛茸茸凸凹| 在线欧美小视频| 久久免费偷拍视频| 日韩精品电影一区亚洲| av亚洲精华国产精华精华| 91精品国产综合久久精品app| 国产日韩在线不卡| 99久久久久免费精品国产 | 大陆成人av片| 欧美大片免费久久精品三p| 亚洲mv在线观看| 欧美视频一区二区三区在线观看| 欧美高清在线一区| 国产高清不卡二三区| 免费久久99精品国产| 欧美三级日本三级少妇99| 亚洲私人黄色宅男| 99久久久无码国产精品| 亚洲欧美激情插| 91福利精品视频| 丝袜亚洲另类欧美| 欧美成人a视频| 日韩亚洲欧美一区| 久久国内精品视频| 久久亚洲综合色一区二区三区| 国产在线国偷精品产拍免费yy| 26uuu国产日韩综合| 国产美女精品一区二区三区| 欧美精品一区男女天堂| 国产一区二区三区电影在线观看| 欧美午夜在线观看| 日产欧产美韩系列久久99| 精品1区2区3区| 激情综合五月婷婷| 国产欧美一区二区三区鸳鸯浴 | 99精品视频免费在线观看| 久久这里只有精品6| 国产一区二区三区四区在线观看| 精品久久久久一区二区国产| 精品一区二区三区蜜桃| 中文字幕电影一区| 欧美精品高清视频| 成人app在线| 日韩国产精品久久久| 久久综合视频网| 97精品久久久久中文字幕| 久久99精品久久久久久国产越南| 欧美激情一区在线观看| 在线观看亚洲a| 成人小视频在线| 欧美久久一二三四区| 99久久精品免费看国产| 国产一区二区在线视频| 亚洲精品乱码久久久久久黑人| 在线观看区一区二| 精品裸体舞一区二区三区| 国内久久精品视频| 奇米一区二区三区| 亚洲乱码精品一二三四区日韩在线| 精品欧美一区二区三区精品久久| 欧美午夜宅男影院| 欧美视频在线一区| 色婷婷av一区二区三区软件 | 麻豆91精品91久久久的内涵| 亚洲最大成人网4388xx| 亚洲视频资源在线| 久久九九久精品国产免费直播| 日韩午夜在线观看视频| 免费在线观看不卡| 一区二区三区四区不卡视频| 亚洲欧美激情插| 一区二区三区精品久久久| 亚洲一区二区欧美| 丝袜国产日韩另类美女| 国产综合久久久久久久久久久久| 国产99久久久久久免费看农村| 国产精品视频免费看| 免费在线看成人av| 精品一区二区三区视频 | 欧美日韩国产经典色站一区二区三区| 另类小说综合欧美亚洲| 风间由美性色一区二区三区| 国产成人午夜视频| 欧美在线看片a免费观看| 精品国产青草久久久久福利| 国产午夜亚洲精品不卡| 亚洲欧洲av一区二区三区久久| 成人免费小视频| 香蕉成人伊视频在线观看| 国产成人综合网| 欧美高清视频一二三区 | 国产高清不卡一区| 色视频一区二区| 国产清纯白嫩初高生在线观看91| 中文一区二区完整视频在线观看| 欧美日韩视频第一区| 国产日韩亚洲欧美综合| 日韩电影免费在线| 夫妻av一区二区| 成人国产精品免费网站| 日韩三级视频在线看| 丝袜诱惑亚洲看片| 91福利国产成人精品照片| 国产精品免费久久| 精品一区二区影视| 欧美一级片免费看| 另类专区欧美蜜桃臀第一页| 欧美高清视频不卡网| 香蕉成人啪国产精品视频综合网| 色婷婷久久一区二区三区麻豆| 亚洲天堂2014| 男人操女人的视频在线观看欧美| 色婷婷综合激情| 色婷婷综合久色| 亚洲黄色尤物视频| 91高清在线观看| 日韩vs国产vs欧美| 日韩一区二区三区在线观看| 日韩精品资源二区在线| 亚洲五月六月丁香激情| 欧美一级片在线看| 国产一区二区三区黄视频| 国产精品二三区| 555夜色666亚洲国产免| 国产精品综合av一区二区国产馆| 亚洲欧美国产三级| 欧美一区二区三区视频在线| 成人91在线观看| 免费在线看成人av| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 一区二区三区在线观看欧美| 色狠狠桃花综合| 久久不见久久见免费视频1| 中文字幕欧美三区| 欧美中文字幕亚洲一区二区va在线 | 精品久久久久久久久久久院品网| 亚洲国产精品精华液网站| 国产精品伦理一区二区| 日韩午夜激情电影| 波多野结衣一区二区三区 | 国产精品免费网站在线观看| 中文字幕制服丝袜一区二区三区| 欧美成人国产一区二区| 久久女同性恋中文字幕| 久久网这里都是精品| 久久久噜噜噜久噜久久综合| 精品成人a区在线观看| 久久美女艺术照精彩视频福利播放| 欧美电视剧免费观看| 精品久久久三级丝袜| 国产精品视频yy9299一区| 欧美视频日韩视频在线观看| www.亚洲色图| 国产福利91精品| 国产精品一区二区在线播放| 国产精品福利电影一区二区三区四区| av激情综合网| 成人深夜在线观看| 欧美在线视频日韩| 2021中文字幕一区亚洲| 国产精品人成在线观看免费| 欧美r级在线观看| 亚洲精品一区二区在线观看| 欧美亚洲愉拍一区二区| 日韩专区在线视频| 免费在线看成人av| 色婷婷久久综合| 成人国产精品免费观看动漫| 国内外成人在线| 成人高清伦理免费影院在线观看| 国产不卡一区视频| 国产综合色产在线精品| 国产成人av电影在线观看| 高清国产一区二区三区| 成人福利在线看| 久久嫩草精品久久久精品一| 一区二区三区欧美| 国产精品一区一区| 亚洲同性同志一二三专区| av一区二区不卡| 制服.丝袜.亚洲.中文.综合| 中文欧美字幕免费| 亚洲五码中文字幕| 99精品热视频| 在线免费精品视频|