public class InputFileTag extends InputTagSupport implements javax.servlet.jsp.tagext.Tag
Tag that generates HTML form fields of type <input type="file" ... />. The only functionality provided above and beyond a straight HTML input tag is that the tag will find its enclosing form tag and ensure that the for is set to POST instead of GET, and that the encoding type of the form is properly set to multipart/form-data as both these settings are necessary to correctly perform file uploads.
Does not perform repopulation because default values for <input type="file/> are not allowed by the HTML specification. One can only imagine this is because a malicious page author could steal a user's files by defaulting the value and using JavaScript to auto-submit forms! As a result the tag does not accept a body because it would have no use for any generated content.
errorRenderer, fieldErrors
pageContext, parentTag
Constructor and Description |
---|
InputFileTag()
Basic constructor that sets the input tag's type attribute to "file".
|
Modifier and Type | Method and Description |
---|---|
int |
doEndInputTag()
Writes out a singleton tag representing the values stored on this tag instance.
|
int |
doStartInputTag()
Locates the parent tag and modifies it's method and enctype to be suitable for file upload.
|
java.lang.String |
getAccept()
Returns the value, if any, set with setAccept().
|
void |
setAccept(java.lang.String accept)
Sets the content types accepted for files being uploaded.
|
doCatch, doEndTag, doFinally, doStartTag, format, format, getActionBean, getDisabled, getFieldErrors, getFormatPattern, getFormatType, getLocalizedFieldName, getLocalizedFieldName, getName, getOverrideValueOrValues, getParentFormTag, getReadonly, getSingleOverrideValue, getSize, getValidationMetadata, getValueOnPage, hasErrors, isItemSelected, loadErrors, makeFocused, registerWithParentForm, setDisabled, setFocus, setFormatPattern, setFormatType, setName, setReadonly, setSize
evaluateExpression, get, getAccesskey, getAttributes, getBodyContent, getBodyContentAsString, getCssClass, getDir, getId, getLang, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getStyle, getTabindex, getTitle, release, set, setAccesskey, setBodyContent, setClass, setCssClass, setDir, setDynamicAttribute, setId, setLang, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setStyle, setTabindex, setTitle, toString, writeAttributes, writeCloseTag, writeOpenTag, writeSingletonTag
getActionBeanType, getActionBeanUrl, getPageContext, getParent, getParentTag, getTagStack, popPageContextAttributes, pushPageContextAttributes, setPageContext, setParent
public InputFileTag()
public void setAccept(java.lang.String accept)
public java.lang.String getAccept()
public int doStartInputTag() throws javax.servlet.jsp.JspException
doStartInputTag
in class InputTagSupport
javax.servlet.jsp.JspException
- if the enclosing form tag cannot be locatedpublic int doEndInputTag() throws javax.servlet.jsp.JspException
doEndInputTag
in class InputTagSupport
javax.servlet.jsp.JspException
- if a problem is encountered writing to the JSP page's output? Copyright 2005-2006, Stripes Development Team.