KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mc > formgenerator > servlets > bonita > ServletInstancesProjects


1 /*
2  * Created on 12 mai 2004
3  *
4  * To change the template for this generated file go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */

7
8 package mc.formgenerator.servlets.bonita;
9
10
11 import java.io.IOException JavaDoc;
12
13 import javax.servlet.http.*;
14
15 /**
16  * It is the servlet of reception which allows the display of the projects intances.
17  * It asks to the Modele class to obtain information,
18  * and redirects the result on JSP page so that posting is separe treatment.
19  * @author delfourr
20  */

21 public class ServletInstancesProjects extends HttpServlet {
22
23
24
25
26     /**
27      * @throws IOException
28      */

29     public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException JavaDoc {
30         
31         //create the modele corresponding to this controller
32
ModeleInstances instance = new ModeleInstances();
33                 
34         //get the session of the user
35
HttpSession session = req.getSession(true);
36
37         //save in the session the modele which has the information to display.
38
session.setAttribute("modeleInstance",instance);
39         
40         
41         try{
42             //Ask to the modele to do its job.
43
instance.process();
44             
45             String JavaDoc url = new String JavaDoc(req.getRequestURL());
46             
47                         //The request is redirected on the JSP 'instanceProject' so that it builds the answer for the user.
48
this.getServletContext().getRequestDispatcher("/web/jsp/instanceProject.jsp").forward(req,res);
49
50         }
51         catch(Exception JavaDoc e){
52             e.printStackTrace();
53             res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
54         }
55     }
56
57
58
59 }
60
Popular Tags