FileUpload Class
- public class FileUpload
extends DataSourceTag
implements IAttributeConsumer
Renders an input tag with type="file", with the given attributes. Usage of this tag requires the parent
Form tag to have enctype="multipart/form-data".
Attribute Descriptions |
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
accept | No | No | No |
The set of MIME types accepted for file upload. |
dataSource | Yes | No | Write Only |
The name of a form bean property or an expression that contains the FormFile. |
readOnly | No | No | No |
Whether or not the TextBox is read-only. |
size | No | No | No |
The visible number of characters in the FileUpload. |
tagId | No | No | No |
The ID of this button used by the enclosing html tag to get the tag's real ID attribute for javascript and focus purposes. The real ID attribute id is generated based upon this name. |
Notes
- The dataSource for the FileUpload tag is write-only. This means that the
value of the FileUpload
cannot get read back into the FileUpload on postback.
- The page flow or form bean property pointed to with the FileUpload's dataSource
should be of type
org.apache.struts.upload.FormFile
.
Related Topics
<netui:fileUpload> Tag Sample
BinaryFlow Sample
Handling Images and Binary Data in Page Flows
Form
-
Hierarchy
-
Object
TagSupport
BodyTagSupport
AbstractBaseTag
DataSourceTag
FileUpload
-
All Implemented Interfaces
-
BodyTag
, IAttributeConsumer
, IterationTag
, Serializable
, Tag
Fields from com.bea.wlw.netui.tags.AbstractBaseTag |
ATTR_GENERAL , ATTR_GENERAL_EXPRESSION , ATTR_JAVASCRIPT , ATTR_STYLE , CLASS , ID , JAVASCRIPT_STATUS , NAME , NETUI_UNIQUE_CNT , ONCLICK , ONDBLCLICK , ONKEYDOWN , ONKEYPRESS , ONKEYUP , ONMOUSEDOWN , ONMOUSEMOVE , ONMOUSEOUT , ONMOUSEOVER , ONMOUSEUP , STYLE , TABINDEX
|
Methods from com.bea.wlw.netui.tags.AbstractBaseTag |
addTagIdMapping , evaluateAttributeToString , filter , filter , getJavaScriptUtils , getNearestForm , getScriptReporter , getUserLocale , localRelease , registerTagError , release , renderAttribute , rewriteName , write
|
Methods from javax.servlet.jsp.tagext.TagSupport |
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
READONLY
public static final String
READONLY
TYPE
public static final String
TYPE
FileUpload
public FileUpload()
doAfterBody() Method
public int doAfterBody()
throws JspException
Save the body content of the FileUpLoad. In this case any body content will
be thrown away.
-
Overrides
-
BodyTagSupport.doAfterBody()
Exceptions
-
JspException
- if a JSP exception has occurred
doEndTag() Method
public int doEndTag()
throws JspException
Render the FileUpload.
-
Overrides
-
BodyTagSupport.doEndTag()
Exceptions
-
JspException
- if a JSP exception has occurred
doStartTag() Method
public int doStartTag()
throws JspException
Prepare FileUpload for rendering
-
Overrides
-
BodyTagSupport.doStartTag()
Exceptions
-
JspException
- if a JSP exception has occurred
getAccept() Method
public String
getAccept()
Gets the mime-types accepted for the FileUpload.
Returns
- the accepted mime-types
getOnBlur() Method
public String
getOnBlur()
Gets the onBlur javascript event.
Returns
- the onBlur event.
getOnChange() Method
public String
getOnChange()
Gets the onChange javascript event.
Returns
- the onChange event.
getOnClick() Method
public String
getOnClick()
Gets the onClick javascript event.
Returns
- the onClick event.
getOnDblClick() Method
public String
getOnDblClick()
Gets the onDblClick javascript event.
Returns
- the onDblClick event.
getOnFocus() Method
public String
getOnFocus()
Gets the onFocus javascript event.
Returns
- the onFocus event.
getOnKeyDown() Method
public String
getOnKeyDown()
Gets the onKeyDown javascript event.
Returns
- the onKeyDown event.
getOnKeyPress() Method
public String
getOnKeyPress()
Gets the onKeyPress javascript event.
Returns
- the onKeyPress event.
getOnKeyUp() Method
public String
getOnKeyUp()
Gets the onKeyUp javascript event.
Returns
- the onKeyUp event.
getOnMouseDown() Method
public String
getOnMouseDown()
Gets the onMouseDown javascript event.
Returns
- the onMouseDown event.
getOnMouseMove() Method
public String
getOnMouseMove()
Gets the onMouseMove javascript event.
Returns
- the onMouseMove event.
getOnMouseOut() Method
public String
getOnMouseOut()
Gets the onMouseOut javascript event.
Returns
- the onMouseOut event.
getOnMouseOver() Method
public String
getOnMouseOver()
Gets the onMouseOver javascript event.
Returns
- the onMouseOver event.
getOnMouseUp() Method
public String
getOnMouseUp()
Gets the onMouseUp javascript event.
Returns
- the onMouseUp event.
getOnSelect() Method
public String
getOnSelect()
Gets the onSelect javascript event.
Returns
- the onSelect event.
getReadonly() Method
public boolean getReadonly()
Gets if this FileUpload is read-only.
Returns
- the read-only state
getSize() Method
public String
getSize()
Gets the size (in characters) of the FileUpload.
Returns
- the size
getStyle() Method
public String
getStyle()
Gets the style of the rendered html tag.
Returns
- the style.
getStyleClass() Method
public String
getStyleClass()
Gets the style class of the rendered html tag.
Returns
- the style class.
getTabindex() Method
public String
getTabindex()
Gets the tabIndex of the rendered html tag.
Returns
- the tabindex.
getTagId() Method
public String
getTagId()
Return the ID of the FileUpload.
Returns
- the ID.
getTagName() Method
public String
getTagName()
Return the name of the Tag.
-
Overrides
-
AbstractBaseTag.getTagName()
localRelease() Method
protected void localRelease()
Release any acquired resources.
-
Overrides
-
DataSourceTag.localRelease()
setAccept(String) Method
public void setAccept(String
accept)
Set the mime-types accepted for the FileUpload.
Parameters
-
accept
- - the accepted mime-types
setAttribute(String, String) Method
public void setAttribute(String
name,
String
value)
throws JspException
Set an attribute value. The name
represents
the name of the attribute.
The value
represents the value and may contain
a netui expression. This method may result in errors being generated.
This requires that the tag buffer its body and
write attributes in the end tag. For the fileupload tag it is not legal to set
the id
, name
or type
attributes with this method.
Parameters
-
name
- The name of the attribute. This value may not be null or the empty string.
-
value
- The value of the attribute. This may contain a netui expression.
Exceptions
-
JspException
- A JspException may be thrown if there is an error setting the attribute.
setOnBlur(String) Method
public void setOnBlur(String
onblur)
Sets the onBlur javascript event.
Parameters
-
onblur
- - the onBlur event.
setOnChange(String) Method
public void setOnChange(String
onchange)
Sets the onChange javascript event.
Parameters
-
onchange
- - the onChange event.
setOnClick(String) Method
public void setOnClick(String
onclick)
Sets the onClick javascript event.
Parameters
-
onclick
- - the onClick event.
setOnDblClick(String) Method
public void setOnDblClick(String
ondblclick)
Sets the onDblClick javascript event.
Parameters
-
ondblclick
- - the onDblClick event.
setOnFocus(String) Method
public void setOnFocus(String
onblur)
Sets the onFocus javascript event.
Parameters
-
onblur
- - the onFocus event.
setOnKeyDown(String) Method
public void setOnKeyDown(String
onkeydown)
Sets the onKeyDown javascript event.
Parameters
-
onkeydown
- - the onKeyDown event.
setOnKeyPress(String) Method
public void setOnKeyPress(String
onkeypress)
Sets the onKeyPress javascript event.
Parameters
-
onkeypress
- - the onKeyPress event.
setOnKeyUp(String) Method
public void setOnKeyUp(String
onkeyup)
Sets the onKeyUp javascript event.
Parameters
-
onkeyup
- - the onKeyUp event.
setOnMouseDown(String) Method
public void setOnMouseDown(String
onmousedown)
Sets the onMouseDown javascript event.
Parameters
-
onmousedown
- - the onMouseDown event.
setOnMouseMove(String) Method
public void setOnMouseMove(String
onmousemove)
Sets the onMouseMove javascript event.
Parameters
-
onmousemove
- - the onMouseMove event.
setOnMouseOut(String) Method
public void setOnMouseOut(String
onmouseout)
Sets the onMouseOut javascript event.
Parameters
-
onmouseout
- - the onMouseOut event.
setOnMouseOver(String) Method
public void setOnMouseOver(String
onmouseover)
Sets the onMouseOver javascript event.
Parameters
-
onmouseover
- - the onMouseOver event.
setOnMouseUp(String) Method
public void setOnMouseUp(String
onmouseup)
Sets the onMouseUp javascript event.
Parameters
-
onmouseup
- - the onMouseUp event.
setOnSelect(String) Method
public void setOnSelect(String
onselect)
Sets the onSelect javascript event.
Parameters
-
onselect
- - the onSelect event.
setReadonly(boolean) Method
public void setReadonly(boolean readonly)
Set if this FileUpload is read-only.
Parameters
-
readonly
- - the read-only state
setSize(String) Method
public void setSize(String
size)
Set the size (in characters) of the FileUpload.
Parameters
-
size
- - the size
setStyle(String) Method
public void setStyle(String
style)
Sets the style of the rendered html tag.
Parameters
-
style
- - the html style.
setStyleClass(String) Method
public void setStyleClass(String
styleClass)
Sets the style class of the rendered html tag.
Parameters
-
styleClass
- - the html style class.
setTabindex(String) Method
public void setTabindex(String
tabindex)
Sets the tabIndex of the rendered html tag.
Parameters
-
tabindex
- - the tab index.
setTagId(String) Method
public void setTagId(String
tagId)
Set the ID of the FileUpload.
Parameters
-
tagId
- - the ID.