|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectTagSupport
BodyTagSupport
AbstractClassicTag
HtmlBaseTag
HtmlFocusBaseTag
HtmlDataSourceTag
FileUpload
public class FileUpload
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".
Notes
org.apache.struts.upload.FormFile.
enctype attribute of the
enclosing <netui:form> tag.
<netui:form action="uploadFile" enctype="multipart/form-data">
<netui:fileUpload tagId="inputbox" dataSource="actionForm.theFile" />
<netui:button value="Upload File" />
</netui:form>
Note that the <netui:fileUpload> tag submits the file to Form Bean property theFile. This
property must be of type org.apache.struts.upload.FormFile:
public static class UploadFileForm extends FormData
{
private org.apache.struts.upload.FormFile theFile;
public void setTheFile(org.apache.struts.upload.FormFile theFile)
{
this.theFile = theFile;
}
public org.apache.struts.upload.FormFile getTheFile()
{
return this.theFile;
}
}| Field Summary |
|---|
| Fields inherited from class HtmlDataSourceTag |
|---|
_dataSource |
| Fields inherited from class AbstractClassicTag |
|---|
DefaultNamingChain, EMPTY_STRING, NETUI_UNIQUE_CNT |
| Fields inherited from class BodyTagSupport |
|---|
bodyContent |
| Fields inherited from class TagSupport |
|---|
id, pageContext |
| Fields inherited from interface BodyTag |
|---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
| Fields inherited from interface IterationTag |
|---|
EVAL_BODY_AGAIN |
| Fields inherited from interface Tag |
|---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
| Constructor Summary | |
|---|---|
FileUpload()
|
|
| Method Summary | |
|---|---|
int |
doEndTag()
Render the FileUpload. |
int |
doStartTag()
Render the fileUpLoad tag. |
protected AbstractHtmlState |
getState()
This method will return the state associated with the tag. |
String |
getTagName()
Return the name of the Tag. |
protected void |
localRelease()
Release any acquired resources. |
void |
setAccept(String accept)
Set the mime-types accepted for the FileUpload. |
void |
setAttribute(String name,
String value,
String facet)
Base support for the attribute tag. |
void |
setReadonly(boolean readonly)
Set if this FileUpload is read-only. |
void |
setSize(String size)
Set the size (in characters) of the FileUpload. |
void |
setTabindex(int tabindex)
Sets the tabIndex of the rendered html tag. |
| Methods inherited from class HtmlDataSourceTag |
|---|
evaluateDataSource, getNamingChain, nameHtmlControl, setDataSource |
| Methods inherited from class HtmlFocusBaseTag |
|---|
isDisabled, setDisabled, setOnBlur, setOnChange, setOnFocus, setOnSelect |
| Methods inherited from class HtmlBaseTag |
|---|
getJavaScriptAttribute, getOnClick, getTagId, renderDefaultNameAndId, renderNameAndId, setDir, setLang, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setStateAttribute, setStyle, setStyleClass, setTagId, setTitle |
| Methods inherited from class BodyTagSupport |
|---|
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
| Methods inherited from class TagSupport |
|---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface Tag |
|---|
getParent, setPageContext, setParent |
| Constructor Detail |
|---|
public FileUpload()
| Method Detail |
|---|
public String getTagName()
getTagName in interface INetuiTaggetTagName in class AbstractClassicTag
public void setAttribute(String name,
String value,
String facet)
throws JspException
type
attribute.
setAttribute in interface IAttributeConsumersetAttribute in class HtmlBaseTagname - The name of the attribute. This value may not be null or the empty string.value - The value of the attribute. This may contain an expression.facet - The name of a facet to which the attribute will be applied. This is optional.
JspException - A JspException may be thrown if there is an error setting the attribute.protected AbstractHtmlState getState()
getState in class HtmlBaseTagAbstractHtmlState class.public void setAccept(String accept)
accept - the accepted mime-typespublic void setReadonly(boolean readonly)
readonly - the read-only statepublic void setSize(String size)
size - the sizepublic void setTabindex(int tabindex)
tabindex - the tab index.
public int doStartTag()
throws JspException
doStartTag in interface TagdoStartTag in class BodyTagSupportJspException - if a JSP exception has occurred
public int doEndTag()
throws JspException
doEndTag in interface TagdoEndTag in class BodyTagSupportJspException - if a JSP exception has occurredprotected void localRelease()
localRelease in class HtmlDataSourceTag
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||