I have a java web application, developed in Spring Framework. In that, I am running a job (like moving data from one database to other database).
I want to track the progress of the operation, not by displaying some progress bar, instead of that, I want to display the real time logs, to track the flow, on the UI.
I was using reverse AJAX using DWR but it seems, excessive use of it, is creating outofmemory error.
How can I achieve it?
web.xml Code
<servlet>
<servlet-name>dwr</servlet-name>
<servlet-class>org.directwebremoting.spring.DwrSpringServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>activeReverseAjaxEnabled</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
Ajax file code
@RemoteMethod
public void moveData() {
String currentPage = WebContextFactory.get().getCurrentPage();
Browser.withPage(currentPage, new Runnable() {
public void run() {
try {
DatabaseUtility.moveDB();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});