Salve, mi è stato assegnato l'esercizio da svolgere in java che consiste nel calcolare il fattoriale di un numero intero dato in ingresso(con controllo del campo), in pratica devo creare una SERVLET. Sono riuscito a fare tutto, l'unico problema è che non riesco a visualizzare a video i risultati parziali, cioè mano mano che il fattoriale viene calcolato; il tutto deve essere cadenzato temporalmente; sono riuscito solo a mostrare a video il risultato finale del fattoriale. La servlet gira correttamente.
Grazie.

PARTE HTML
codice:
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> 
<body> <form action="fattoriale" method="post">   
 <h3>Inserisci numero intero</h3>  
<input type="TEXT" name="intero"> 
  
 <input type="submit" name="invianumero" value="Calcola fattoriale!">  
 </form>  
</body> </html>

PARTE JAVA
codice:
 
import java.io.IOException;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class fattoriale
 */
public class fattoriale extends HttpServlet {
	private static final long serialVersionUID = 1L;
	
	

	
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public fattoriale() {
        super();
        // TODO Auto-generated constructor stub
    }
    

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		response.setContentType("text/html");
		PrintWriter responseOutput = response.getWriter();
		
		
		if (request.getParameter("invianumero")=null) {
			
			
			
			
		
			try {
				// converto la stringa in un numero intero 
				int numero = int.parseint(stringa);
		    
				if (numero < 0){
					
				
					System.out.println("

Attenzione! Immettere un numero intero");}// fine if
				
				if(numero > 0){
					 
				 
				
				long fatt = 1;    
				for (int i = 1; i <= numero; i++)
				
			
				
				System.out.println.println("

Il fattoriale di "+numero+ " è "+fatt);
				
				}// fine if

				
			
	
			}
		}
	}