All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyXMLFilter Maven / Gradle / Ivy

Go to download

Ajax4jsf is an open source extension to the JavaServer Faces standard that adds AJAX capability to JSF applications without requiring the writing of any JavaScript.

The newest version!
package org.ajax4jsf.framework.ajax.xmlfilter.tidy;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;

import org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter;
import org.ajax4jsf.framework.ajax.xmlfilter.FilterServletResponseWrapper;
import org.ajax4jsf.framework.ajax.xmlfilter.HtmlParser;
import org.ajax4jsf.framework.ajax.xmlfilter.TidyServletResponseWrapper;
import org.ajax4jsf.framework.util.message.Messages;
import org.ajax4jsf.io.parser.FastHtmlParser;
import org.apache.commons.collections.ArrayStack;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class TidyXMLFilter extends BaseXMLFilter {
	static final Log log = LogFactory.getLog(TidyXMLFilter.class);
	private Properties _tidyProperties;
	private static final int STACK_SIZE = 100;

	/**
	 * Stack for handle parsers pool - to avoid instantiane on each request.
	 */
	private ArrayStack _parsersPool = new ArrayStack(STACK_SIZE);	

	public TidyXMLFilter() {}

	/**
     * Peturn parser to pool
	 * @param parser
	 */
	protected void reuseParser(HtmlParser parser) {
//		synchronized (_parsersPool) {
//			if (_parsersPool.size()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy