un ultima cosa..
poikè io ho creato le webpage dinamiche nasce un piccolo problema
in pratica nel file .htm ci dovrebbero essere tante select il cui nome è dato da una stringa più un contatore ke si DOVREBBE incrementare di uno
ora quando io nella servlet prendo il paramentro io l'ho implementato come un array dove la lunghezza la so perkè mi sono creato un file .txt in cui mi sono contenuti il numero di item da dare un rate e questo sarà la dimensione dell'array
solo ke quando provo a avviarlo mi fa il difetto di prima cioè mi da nel nuovo file .xml quelle scritte ke ho postato prima e ho notato ke questo difetto lo fa quando voglio leggere un file .txt ed utilizzare il valore contenuto all'interno..

ora posto il codice del do post magari c'è qualke errore
codice:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
		
		Calendar calendar = new GregorianCalendar();
			
		StringBuffer buf = new StringBuffer();
		response.setContentType("text/html");
		PrintWriter responseOutput = response.getWriter();
		buf.append("<html><head></head><body><table border=\"1\" width=\"40%\" align=\"center\"><tbody><tr>");
		
		
 		//preleva dal file ItemCount.txt il totale degli item da votare
		//String tempIDPath = new String("C:/Programmi/Apache Software Foundation/Tomcat 6.0/webapps/ITemRecommender/temp/IDItem - " + calendar.get(Calendar.DAY_OF_MONTH) + "/" + calendar.get(Calendar.MONTH) + "/" + calendar.get(Calendar.YEAR) + ".txt");

		String tempCountPath = new String("C:/Programmi/Apache Software Foundation/Tomcat 6.0/webapps/ITemRecommender/temp/IDCount.txt");
		File tempCountFile = new File(tempCountPath);
		BufferedReader readTempCount = new BufferedReader( new FileReader(tempCountFile));
 		
 		String line2;
 		String countLine = "";
   		//Leggo tutto il file e lo butto in una variabile temporanea
   		while ((line2 = readTempCount.readLine()) != null){
     		countLine += line2;
  		}
  		readTempCount.close();
	
	int count = Integer.valueOf(countLine).intValue();
	rating_inviato = new String[count];	
	for (i = 0; i < rating_inviato.length; i++) {
	
		//RECUPERO LE INFORMAZIONI INVIATE DAL FORM
		rating_inviato[i] = request.getParameter("rated" + i);
		
			if (rating_inviato[i] != ""){	
				HttpSession session = request.getSession(true);
				//String username = (String)session.getAttribute("Username");
				//CONTROLLO SE ESISTE GIA' UN FILE .XML CHE SI CHIAMA REGISTRATI
				String path = new String ("C:/Programmi/Apache Software Foundation/Tomcat 6.0/webapps/ITemRecommender/xml/Recommendations.xml");
				File file = new File(path);
				//SE IL FILE NON ESISTE LO CREO E GLI AGGIUNGO L'ELEMENTO RADICE IL PRIMO ITEM CON RATING
				if (!file.exists()){
					file.createNewFile();
					elementoRate = new Element("recommendations");
					//AGGIUNGO IL RATING CHE RISULTA IL PRIMO DATO CHE IL FILE RECOMMENDATIONS.XML NON ESISTEVA
					aggiungiRatedItem();
					//SCRIVO IL DOCUMENT NEL FILE		
					documento = new Document(elementoRate);
					XMLOutputter xmlOutputter = new XMLOutputter();
					try{
   						FileOutputStream fileOutputStream = new FileOutputStream(new File(path)); 
   						xmlOutputter.output(documento, fileOutputStream);
   						buf.append("<td align=\"center\">

Items Rated.

<a href=\"index.htm\">Proceed

</a></p>
</td>");
	 				}
	 				catch (FileNotFoundException ex){
   						System.err.println(ex);
 					}
	 				catch (IOException ex){
   						System.err.println(ex);
 					}
				}
				else{
					//SE IL FILE ESISTE LO CARICO IN MEMORIA
 					SAXBuilder saxBuilder = new SAXBuilder();
					try{
   						documento = saxBuilder.build(new File(path)); 
 					}
 					catch (JDOMException ex){
   						System.err.println(ex);
					}
	 				catch (IOException ex){
   						System.err.println(ex);
 					}					
					//RISCRIVO L'INTERO DOCUMENTO NEL FILE XML DOPO AVER AGGIUNTO IL RATING
					aggiungiRatedItem();
					XMLOutputter xmlOutputter = new XMLOutputter();
	 				//IL METODO SEGUENTE Format.getPrettyFormat() SERVE PER SCRIVERE SUL FILE XML IN MODO BEN FORMATTATO 
	 				//CON GLI A CAPO E LE INDENTAZIONI PER OGNI ELEMENTO, ma non lo accetta
					//xmlOutputter.setFormat(Format.getPrettyFormat());
	    			try{
	   					FileOutputStream fileOutputStream = new FileOutputStream(new File(path)); 
	   					xmlOutputter.output(documento, fileOutputStream);
	   					buf.append("<td align=\"center\">

Items Rated.

<a href=\"index.htm\">Proceed

</a></p>
</td>");
	 				}
				 	catch (FileNotFoundException ex){
	   					System.err.println(ex);
	 				}
				 	catch (IOException ex){
	   					System.err.println(ex);
	 				}
				}			
			}
			else{
				buf.append("<td align=\"center\">

Missing informations, try again

<a href=\"RecommendedItem.htm\">Go Back


</a></p>
</td>");
			}
		}
		
		buf.append("</tr></tbody></table></body></html>");
		responseOutput.println(buf.toString());
		responseOutput.close();
    }
il codice in grassetto è la parte ke ho aggiunto considerando un array di stringhe per contenere i valori dei parametri ottenuti da un combobox presente nella relativa pagina web
il fatto è ke non mi da nessun errore ma se levo la lettura del .txt e non utilizzo il valore in esso contenuto nel resto del codice va perkè?