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

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

?? xsltview.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.servlet.view.xslt;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
import javax.xml.transform.URIResolver;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

import org.w3c.dom.Document;
import org.w3c.dom.Node;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContextException;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.util.xml.SimpleTransformErrorListener;
import org.springframework.web.servlet.view.AbstractUrlBasedView;
import org.springframework.web.util.WebUtils;

/**
 * XSLT-driven View that allows for response context to be rendered as the
 * result of an XSLT transformation.
 *
 * <p>The XSLT Source object is supplied as a parameter in the model and then
 * {@link #locateSource detected} during response rendering. Users can either specify
 * a specific entry in the model via the {@link #setSourceKey sourceKey} property or
 * have Spring locate the Source object. This class also provides basic conversion
 * of objects into Source implementations. See {@link #getSourceTypes() here}
 * for more details.
 *
 * <p>All model parameters are passed to the XSLT Transformer as parameters.
 * In addition the user can configure {@link #setOutputProperties output properties}
 * to be passed to the Transformer.
 *
 * @author Rob Harrop
 * @author Juergen Hoeller
 * @since 2.0
 */
public class XsltView extends AbstractUrlBasedView {

	private Class transformerFactoryClass;

	private String sourceKey;

	private URIResolver uriResolver;

	private ErrorListener errorListener = new SimpleTransformErrorListener(logger);

	private boolean indent = true;

	private Properties outputProperties;

	private boolean cacheTemplates = true;

	private TransformerFactory transformerFactory;

	private Templates cachedTemplates;


	/**
	 * Specify the XSLT TransformerFactory class to use.
	 * <p>The default constructor of the specified class will be called
	 * to build the TransformerFactory for this view.
	 */
	public void setTransformerFactoryClass(Class transformerFactoryClass) {
		Assert.isAssignable(TransformerFactory.class, transformerFactoryClass);
		this.transformerFactoryClass = transformerFactoryClass;
	}

	/**
	 * Set the name of the model attribute that represents the XSLT Source.
	 * If not specified, the model map will be searched for a matching value type.
	 * <p>The following source types are supported out of the box:
	 * {@link Source}, {@link Document}, {@link Node}, {@link Reader},
	 * {@link InputStream} and {@link Resource}.
	 * @see #getSourceTypes
	 * @see #convertSource
	 */
	public void setSourceKey(String sourceKey) {
		this.sourceKey = sourceKey;
	}

	/**
	 * Set the URIResolver used in the transform.
	 * <p>The URIResolver handles calls to the XSLT <code>document()</code> function.
	 */
	public void setUriResolver(URIResolver uriResolver) {
		this.uriResolver = uriResolver;
	}

	/**
	 * Set an implementation of the {@link javax.xml.transform.ErrorListener}
	 * interface for custom handling of transformation errors and warnings.
	 * <p>If not set, a default
	 * {@link org.springframework.util.xml.SimpleTransformErrorListener} is
	 * used that simply logs warnings using the logger instance of the view class,
	 * and rethrows errors to discontinue the XML transformation.
	 * @see org.springframework.util.xml.SimpleTransformErrorListener
	 */
	public void setErrorListener(ErrorListener errorListener) {
		this.errorListener = (errorListener != null ? errorListener : new SimpleTransformErrorListener(logger));
	}

	/**
	 * Set whether the XSLT transformer may add additional whitespace when
	 * outputting the result tree.
	 * <p>Default is <code>true</code> (on); set this to <code>false</code> (off)
	 * to not specify an "indent" key, leaving the choice up to the stylesheet.
	 * @see javax.xml.transform.OutputKeys#INDENT
	 */
	public void setIndent(boolean indent) {
		this.indent = indent;
	}

	/**
	 * Set arbitrary transformer output properties to be applied to the stylesheet.
	 * <p>Any values specified here will override defaults that this view sets
	 * programmatically.
	 * @see javax.xml.transform.Transformer#setOutputProperty
	 */
	public void setOutputProperties(Properties outputProperties) {
		this.outputProperties = outputProperties;
	}

	/**
	 * Turn on/off the caching of the XSLT {@link Templates} instance.
	 * <p>The default value is "true". Only set this to "false" in development,
	 * where caching does not seriously impact performance.
	 */
	public void setCacheTemplates(boolean cacheTemplates) {
		this.cacheTemplates = cacheTemplates;
	}


	/**
	 * Initialize this XsltView's TransformerFactory.
	 */
	protected void initApplicationContext() throws BeansException {
		this.transformerFactory = newTransformerFactory(this.transformerFactoryClass);
		this.transformerFactory.setErrorListener(this.errorListener);
		if (this.uriResolver != null) {
			this.transformerFactory.setURIResolver(this.uriResolver);
		}
		if (this.cacheTemplates) {
			this.cachedTemplates = loadTemplates();
		}
	}

	/**
	 * Instantiate a new TransformerFactory for this view.
	 * <p>The default implementation simply calls
	 * {@link javax.xml.transform.TransformerFactory#newInstance()}.
	 * If a {@link #setTransformerFactoryClass "transformerFactoryClass"}
	 * has been specified explicitly, the default constructor of the
	 * specified class will be called instead.
	 * <p>Can be overridden in subclasses.
	 * @param transformerFactoryClass the specified factory class (if any)
	 * @return the new TransactionFactory instance
	 * @see #setTransformerFactoryClass
	 * @see #getTransformerFactory()
	 */
	protected TransformerFactory newTransformerFactory(Class transformerFactoryClass) {
		if (transformerFactoryClass != null) {
			try {
				return (TransformerFactory) transformerFactoryClass.newInstance();
			}
			catch (Exception ex) {
				throw new TransformerFactoryConfigurationError(ex, "Could not instantiate TransformerFactory");
			}
		}
		else {
			return TransformerFactory.newInstance();
		}
	}

	/**
	 * Return the TransformerFactory that this XsltView uses.
	 * @return the TransformerFactory (never <code>null</code>)
	 */
	protected final TransformerFactory getTransformerFactory() {
		return this.transformerFactory;
	}


	protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response)
			throws Exception {

		Templates templates = this.cachedTemplates;
		if (templates == null) {
			templates = loadTemplates();
		}

		Transformer transformer = createTransformer(templates);
		configureTransformer(model, response, transformer);
		configureResponse(model, response, transformer);
		Source source = null;
		try {
			source = locateSource(model);
			if (source == null) {
				throw new IllegalArgumentException("Unable to locate Source object in model: " + model);
			}
			transformer.transform(source, createResult(response));
		}
		finally {
			closeSourceIfNecessary(source);
		}
	}

	/**
	 * Create the XSLT {@link Result} used to render the result of the transformation.
	 * <p>The default implementation creates a {@link StreamResult} wrapping the supplied
	 * HttpServletResponse's {@link HttpServletResponse#getOutputStream() OutputStream}.
	 * @param response current HTTP response
	 * @return the XSLT Result to use
	 * @throws Exception if the Result cannot be built

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲三级电影全部在线观看高清| 一本色道综合亚洲| 久久成人综合网| 欧美一区二区三区爱爱| 亚洲视频在线观看三级| 国产精品一区在线| 国产亚洲女人久久久久毛片| 精品一区二区三区的国产在线播放| 欧洲精品一区二区| 亚洲国产视频直播| 777午夜精品视频在线播放| 亚洲123区在线观看| 欧美一区永久视频免费观看| 日本vs亚洲vs韩国一区三区二区| 91精品国产全国免费观看| 日韩不卡一区二区三区| www久久精品| 国产91在线看| 亚洲视频免费观看| 欧美三级欧美一级| 蜜桃视频一区二区三区在线观看| 欧美va亚洲va| 成人精品国产一区二区4080| 亚洲欧洲精品天堂一级| 欧美色视频在线| 激情综合亚洲精品| 亚洲精品福利视频网站| 日韩欧美中文字幕一区| 99久久国产综合色|国产精品| 亚洲黄色录像片| 国产午夜精品理论片a级大结局| 成人av电影免费在线播放| 日韩精品一区第一页| 国产欧美一区二区在线观看| 欧美性做爰猛烈叫床潮| 亚洲国产精品久久艾草纯爱| 欧美日本乱大交xxxxx| 欧美一区二区三区影视| 日韩欧美一区中文| 久久天堂av综合合色蜜桃网| 日韩女优av电影| 久久综合999| 亚洲国产高清aⅴ视频| 亚洲图片你懂的| 午夜精品爽啪视频| 蜜臀久久99精品久久久久久9| 精品一区二区精品| 成人av在线影院| 91精品国产综合久久久久久久| 日韩视频一区二区三区在线播放 | 日本最新不卡在线| 国产一区高清在线| 久久精品一区二区| 蜜桃视频第一区免费观看| 亚洲综合成人网| 亚洲伊人伊色伊影伊综合网| 亚洲愉拍自拍另类高清精品| 亚洲国产精品久久艾草纯爱| 亚洲精品视频免费看| 亚洲图片欧美视频| 久久精品国产亚洲高清剧情介绍| 亚洲高清免费视频| 舔着乳尖日韩一区| 麻豆精品一区二区三区| 国模大尺度一区二区三区| 国产自产视频一区二区三区| 福利一区二区在线| 在线观看日产精品| 精品欧美一区二区久久| 国产精品视频免费看| 亚洲国产精品久久人人爱 | 日韩激情av在线| 国产盗摄一区二区三区| 久久精品免视看| 久久久综合精品| 91久久精品一区二区三| 欧美疯狂做受xxxx富婆| 亚洲国产日韩一区二区| 丝袜诱惑制服诱惑色一区在线观看 | 亚洲午夜激情av| 不卡一区二区中文字幕| 欧美一区二区三区啪啪| 91福利视频在线| 成人av电影在线播放| 成人自拍视频在线观看| 老司机免费视频一区二区三区| 91精品国产色综合久久ai换脸 | 欧美三级三级三级| 欧美私模裸体表演在线观看| 精品国内二区三区| 亚洲伦在线观看| 久久99久久99| 欧美日韩午夜影院| 亚洲欧洲精品天堂一级| 久久国产人妖系列| 欧美中文字幕一区| 中文子幕无线码一区tr| 免费在线欧美视频| 欧美色电影在线| 一区二区三区在线看| 九色综合国产一区二区三区| 91久久精品日日躁夜夜躁欧美| 久久久久国产精品麻豆| 日韩精品一二区| 91精品国产综合久久精品麻豆| 成人免费在线播放视频| 在线观看av一区| 亚洲精品欧美二区三区中文字幕| 成人国产精品免费| 国产精品美女久久久久av爽李琼 | 国产无一区二区| 蜜桃91丨九色丨蝌蚪91桃色| 色婷婷av一区二区三区大白胸| 中文幕一区二区三区久久蜜桃| 国产精品亚洲人在线观看| 精品日韩av一区二区| 国产日本欧洲亚洲| av电影一区二区| 亚洲美女区一区| 99re8在线精品视频免费播放| 国产精品成人一区二区三区夜夜夜| 国产宾馆实践打屁股91| 亚洲综合区在线| 欧美日本精品一区二区三区| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美精品一区二区三区久久久 | 欧美日韩卡一卡二| 国产高清不卡一区二区| 一二三区精品福利视频| 欧美一区二区三区在线看| 国产精品一线二线三线| 《视频一区视频二区| 色婷婷精品大在线视频| 国产一区二区三区电影在线观看| 日本一区二区视频在线观看| 91黄色激情网站| 久久99精品久久久| 樱花影视一区二区| 国产精品麻豆欧美日韩ww| 6080国产精品一区二区| 高清av一区二区| 日韩成人精品视频| 亚洲伦理在线精品| 欧美大尺度电影在线| 91免费国产视频网站| 国产精华液一区二区三区| 天天综合天天综合色| 日韩美女视频一区二区| 欧美天堂一区二区三区| 欧洲生活片亚洲生活在线观看| 国产99久久久国产精品潘金网站| 午夜精品一区二区三区电影天堂| 国产精品第13页| 久久色中文字幕| 国产精品欧美久久久久一区二区| 日韩欧美一区二区不卡| 欧美精品九九99久久| 欧美亚洲综合一区| 欧美午夜精品理论片a级按摩| 欧美综合一区二区| 91浏览器在线视频| 欧美手机在线视频| 欧美电影影音先锋| 精品国产自在久精品国产| 2欧美一区二区三区在线观看视频| 欧美成人在线直播| 国产亚洲欧美在线| 亚洲人成网站影音先锋播放| 久久综合网色—综合色88| 最新久久zyz资源站| 一区二区在线观看免费视频播放| 亚洲伦理在线精品| 日韩精品一二三四| 蜜桃av噜噜一区| 在线观看不卡一区| 久久综合久久99| 一区在线观看免费| 日本欧美加勒比视频| 91免费国产在线观看| 91麻豆精品国产91久久久使用方法| 91精品国产入口| 国产精品国产自产拍高清av王其| 亚洲视频一区在线| 国内精品伊人久久久久av影院| 成人av电影观看| 欧美一区二区日韩| 亚洲精品久久嫩草网站秘色| 国产精品99久| 7777精品久久久大香线蕉| 国产欧美一区二区精品性| 亚洲综合成人在线| 岛国精品一区二区| 久久久综合网站| 全部av―极品视觉盛宴亚洲| 北岛玲一区二区三区四区| 欧美成人伊人久久综合网| 日韩高清一区在线| 欧美美女bb生活片| 一区二区三区在线视频播放| 国产精品一区在线观看乱码|