Q:
How to upload struts file in DHTML?
Answer
The interface org.apache.struts.upload.FormFile is used for the struts file upload application. This interface represents a file that has been uploaded by a client. It is the only interface or class in upload package which is typically referenced directly by a Struts application.
This is not specific to Struts in case of DHTML but the two things that are needed in DHTML page is: first, the form needs to specify an enctype of multipart/form-data and second an <input> form control of type file.
Following are the steps to load file in DHTML:
- Creating a bean
- Writing the ActionClass.
- Mapping the bean in struts-config.xml
- Defining actionmapping
- Developing the DHTML page.
View answer
Workspace
Report Error
Discuss