01: /*
02: * Created on 12 mai 2004
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07:
08: package mc.formgenerator.servlets.bonita;
09:
10: import java.io.IOException;
11:
12: import javax.servlet.http.*;
13:
14: /**
15: * It is the servlet of reception which allows the display of the projects intances.
16: * It asks to the Modele class to obtain information,
17: * and redirects the result on JSP page so that posting is separe treatment.
18: */
19: public class ServletInstancesProjects extends HttpServlet {
20:
21: /**
22: * @throws IOException
23: */
24: public void doGet(HttpServletRequest req, HttpServletResponse res)
25: throws IOException {
26:
27: //create the modele corresponding to this controller
28: ModeleInstances instance = new ModeleInstances();
29:
30: //get the session of the user
31: HttpSession session = req.getSession(true);
32:
33: //save in the session the modele which has the information to display.
34: session.setAttribute("modeleInstance", instance);
35:
36: try {
37: //Ask to the modele to do its job.
38: instance.process();
39:
40: String url = new String(req.getRequestURL());
41:
42: //The request is redirected on the JSP 'instanceProject' so that it builds the answer for the user.
43: this .getServletContext().getRequestDispatcher(
44: "/web/jsp/instanceProject.jsp").forward(req, res);
45:
46: } catch (Exception e) {
47: e.printStackTrace();
48: res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
49: e.getMessage());
50: }
51: }
52:
53: }
|