Bonjour

Dans une servlet, je crée un répertoire suivant un nom donné dans un formulaire. Seulement, cette servlet ne fonctionne pas. Voici le code puis l'erreur en question:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String reponame = req.getParameter("reponame");
		if(reponame.compareTo("")==0){
			returnError("Your text field was void !", req, resp, "createrep.jsp");
		}
 
		if(reponame.compareTo("/")==0){
			returnError("You can not create a repertory named \'/\' !", req, resp, "createrep.jsp");
		}
 
		Pattern p = Pattern.compile("(\\/{0,1}\\w)*");
		Matcher m = p.matcher(reponame);
		if(!m.matches()){
			returnError("Your path is not well written !", req, resp, "createrep.jsp");
		}
 
		String filepath = repos+reponame;
		File newrep = new File(filepath);
		if(!newrep.mkdir()){
			returnError("Can not create your repertory !", req, resp, "createrep.jsp");
		}
		else{
			returnMessage("Repertory created successfully", req, resp, "createrep.jsp");
		}
	}
 
	public void returnError(String error, HttpServletRequest req, HttpServletResponse resp, String page) throws ServletException, IOException{
		req.setAttribute("error", error);
		RequestDispatcher rd = req.getRequestDispatcher(page);
		rd.forward(req, resp);
	}
 
	public void returnMessage(String message, HttpServletRequest req, HttpServletResponse resp, String page) throws ServletException, IOException{
		req.setAttribute("ok", message);
		RequestDispatcher rd = req.getRequestDispatcher(page);
		rd.forward(req, resp);
	}
L'erreur se situe dans ma méthode returnError telle que :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
 
java.lang.IllegalStateException: Impossible d'utiliser faire-suivre (forward) après que la réponse ait été envoyée
	com.bioxpr.servlet.CreateDirectory.returnError(CreateDirectory.java:52)
Tiens ?? Comment cela se fait ?
Merci d'avance.

@++