Upload file content to text box using struts 1.3.8

2010-11-29 Thread Anjib Mulepati
Can anyone help me on getting file content (txt/CSV file) to be load in text area of web page? I have textarea in webpage and want to load the content of the file to that textarea. I am using struts 1.3.8. I couldn't fig out how can mimic file input button. Any hint will be appreciated.

Re: Upload file content to text box using struts 1.3.8

2010-11-29 Thread Li Ying
(1)Select file from a [file input] (2)Upload it to your Action (by a post) (3)In your action, read in the CSV data, and store into some property(let's say CSVDataProperty) (4)Show your page again, and set the default value of the textarea by CSVDataProperty 2010/11/30 Anjib Mulepati

Re: Upload file content to text box using struts 1.3.8

2010-11-29 Thread Anjib
This textarea itself is one of the component of the form. So how to put two forms in a single page? On 11/29/2010 9:30 PM, Li Ying wrote: (1)Select file from a [file input] (2)Upload it to your Action (by a post) (3)In your action, read in the CSV data, and store into some property(let's

Re: Upload file content to text box using struts 1.3.8

2010-11-29 Thread Li Ying
Why do you need two forms? Can't you put the FileUpload and the textarea in one form? And in your Action, you can create 2 method, one handle the file upload, and the other one handle the other request - To unsubscribe,

Re: Upload file content to text box using struts 1.3.8

2010-11-29 Thread Li Ying
Another way is, using AJAX: (1)Send a file upload post, (using AJAX), to your FileUploadAction (2)FileUploadAction just read in the CSV file content, and return it as HTTP Response (3)On client side, AJAX can receive the Server response, then you can put it to the textarea (using JQuery) See: