How to read HTML file and display it for user’s confirmation?

How to read HTML file and display it for user’s confirmation?
This is part of the file upload process using Struts.

1.      I developed the upload file page, where I can choose HTML file.
2.      In Action class I need to read that file and display it to the user for confirmation.
3.      After “confirm” save it  to the DB2 table
4.      Display that HTML file, as part of the  “Welcome page”.
The Welcome page should get the last row from the DB2 table and display it.

I am new in Web development trying to switch from  the mainframe.
Really need your help.
I am using Struts, JSP and Java.

Who is Participating?
arun_kuttzConnect With a Mentor Commented:
The follolwing site has a tutorial on how to upload a file using struts.. all it requires is that u use a FormBean with a "FormFile" property..

1. in the ServeltUploadAction, set the FormFile as a session attribute using :
request.getSession().setAttribute("uploadedFile", <FormFile object u obtained from the Form bean>).

2. then you forward to another JSP page ( in the last line of the ActionClasss, "mapping.findForward()", you can tell struts where for forward the request to ).

3. in the JSP page, like objects mentioned, you create an IFRAME, you then set the "src" attribute of the IFRAME to another Struts ActionClass that streams the above metioned FormFile into the response object. using :


hope it works..

if you make it accessible on the web server you can provide a link for the user to view it.
perhaps in anm iframe allowing you to also include your own content such as a confirmirmation form on the page
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.