File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes how to set default value to the struts html:file using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to set default value to the struts html:file using javascript" Watch "how to set default value to the struts html:file using javascript" New topic
Author

how to set default value to the struts html:file using javascript

Nani Palle
Greenhorn

Joined: Apr 10, 2009
Posts: 4
Hi...

I have some problem is when i click browse button for uploading file,it is displaying some error message(done for some business requirment),when it is displaying error message,the corresponding html:file value should be null,but how to set null value to html:file.

please provide solutions as soon as possible

Thanks
yadavendar
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

You have a bean which contain a property of type "File" which is mapped to the html:file attribute, In a bean, just initialize the "File" property with "null"and user reset() method of ActionForm to set it 'null'.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to set default value to the struts html:file using javascript
 
Similar Threads
Problem Validating html:file
Custom CellRenderer
Issue with [html:file] tag
facing serious problem with struts html:file element
how to set selected path to struts html:file when it redirects to same page