Calling a Jython script from a Java Servlet returns incomplete output
Sorry for the blast.
I am trying to call a Jython Script from a java servlet. It uses the org.python.utils.PythonInterpreter as shown below. The servlet is running under Tomcat. This works perfectly fine for the first time and sometimes 2-3 times and returns completely correct output to the calling browser page. However in the second or later calls of the servlet only few lines are returned to the web browser. The browser comes to the "done" state quickly with few output lines instead of waiting the background process which is still running.
I am using a out = res.getWriter() to write output back to the web page.
out = res.getWriter()
PythonInterpreter interp = new PythonInterpreter ()
// Execute the script
Any help / pointer would be highly appreciated.