How to send report generated message to browser console in Java backend application?
P粉593649715
P粉593649715 2023-08-09 16:53:33
0
1
631
<p>I have a Java backend application that has a button that generates a report when clicked. I want to provide real-time updates to the user during report generation. </p> <p>Specifically, when the button is clicked, I want to display a message in the browser console such as "<strong>Report generation started</strong>" and when the process completes" <strong>Report generation completed</strong>". Since the duration of report generation is variable, I also want to inform the user that we don't know how long it will take to generate the report. </p> <p>Can anyone provide guidance on how to implement this functionality using JavaScript or Java? What steps and code snippets are required to implement this kind of real-time messaging in the browser console? </p>
P粉593649715
P粉593649715

reply all(1)
P粉301523298

I don’t know what your mark looks like, but I guess the button you are talking about looks like this:

<button id="foo" onclick="generateReport()">点击我</button>

Since you said that button is already generating a report, there must be a click handler. Here, I call it generateReport. In this function, it is assumed that an AJAX request will be made to your server to generate and download the report.

When the AJAX request completes successfully, you will want to log that the report has been generated.

I can’t explain more without seeing the code.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template