[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-05-06
2
Medium Priority
?
259 Views
Last Modified: 2010-03-31
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.


0
Comment
Question by:tpolnyi
2 Comments
 
LVL 92

Expert Comment

by:objects
ID: 16622878
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
0
 
LVL 3

Accepted Solution

by:
arun_kuttz earned 1500 total points
ID: 16625270
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..

http://www.roseindia.net/struts/strutsfileupload.shtml

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 :

response.getOutputStream.write(request.getSession().getAttribute("uploadedFile"));

hope it works..

-KuTtZ
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question