0

I am working on a project which is developed with Java Struts 2 framework. I am completely new to this. In project, when user clicks on a report button, a report is shown in different tab (the url of it looks like https://localhost:8181/myApplication/businessReport.do).

Goal: What I want is saving this report as html file in backend somehow. It is perfectly OK when user sees the report as he is seeing currently. It just needs to be saved in backend somewhere. The reason to do this is, te application is going to shutdown soon and our client wants to save those reports somewhere for future reference.

I could find businessReportForm.java, businessReportAction.java and also businessReport.jsp files in my project. I assume they should be of my interest. Note: It uses mapping.findForward from Action mapping

I do not understand following and it would be nice if someone can help with that.

  1. What could be the last point in (with respect to strut framework) where all the information for report would be ready ? (I would lke to use it to create .html file out of it)

  2. What I need to change here in order to achieve the goal ? changing .jsp , changing Action or should change be done in corresponding Action class ?

  3. in the url what does businessProcess.do actually mean with respect to jsp and servlet ?

  4. any other idea what should be the approach to do what I want to do ? (saving report as html in background)

user523956
  • 501
  • 2
  • 9
  • 23
  • On the server side? That's problematic since the browser makes additional requests besides just the HTML send back by an action (e.g., images, CSS, JS), and even *more* problematic if there's anything happening dynamically on the client side (e.g., Ajax or additional post-load JS). I'd also argue it makes very little sense to save such artifacts as HTML; you'd be better off creating PDFs or something. – Dave Newton Jul 21 '20 at 14:10
  • Thanks for your response @Dave Newton. Having it in PDF would be even nicer. Could you give some idea about in which layer, storing report as PDF/HTML should be done ? in Action class ? The files can be stored locally. (which will later be uploaded to some permanant drive.) – user523956 Jul 22 '20 at 07:08

0 Answers0