package it.mice.voila.runtime.springmvc.taglibs;

import java.beans.PropertyEditor;

public class HiddenInputTag extends org.springframework.web.servlet.tags.form.HiddenInputTag {
	private Object value;

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	/**
	 * Get the display value of the supplied <code>Object</code>, HTML escaped
	 * as required. If the supplied value is not a {@link String} and the supplied
	 * {@link PropertyEditor} is not null then the {@link PropertyEditor} is used
	 * to obtain the display value.
	 */
	protected String getDisplayString(Object value, PropertyEditor propertyEditor) {
		return super.getDisplayString((getValue() != null ? getValue() : value), propertyEditor);
	}

	@Override
	public void doFinally() {
		setValue(null);
		super.doFinally();
	}

}
