Source code: com/obinary/cms/Dispatcher.java
1 /**
2 *
3 * Magnolia and its source-code is licensed under the LGPL.
4 * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5 * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6 * you are required to provide proper attribution to obinary.
7 * If you reproduce or distribute the document without making any substantive modifications to its content,
8 * please use the following attribution line:
9 *
10 * Copyright 1993-2003 obinary Ltd. (http://www.obinary.com) All rights reserved.
11 *
12 * */
13
14
15
16 package com.obinary.cms;
17
18
19 import javax.servlet.http.HttpServletRequest;
20 import javax.servlet.http.HttpServletResponse;
21 import javax.servlet.ServletContext;
22 import javax.servlet.RequestDispatcher;
23 import javax.servlet.ServletException;
24 import java.io.IOException;
25
26
27
28 /**
29 * User: sameercharles
30 * Date: Apr 28, 2003
31 * Time: 11:20:59 AM
32 * @author Sameer Charles
33 * @version 1.0
34 */
35
36
37 public class Dispatcher {
38
39
40
41
42 /**
43 * <p>dispatches the current requested to the handler JSP / Servlet</p>
44 *
45 * @throws ServletException
46 * @throws IOException
47 */
48 public static void dispatch(HttpServletRequest req, HttpServletResponse res, ServletContext sc) throws ServletException, IOException {
49 String requestReceiver = (String)req.getAttribute(Aggregator.REQUEST_RECEIVER);
50 RequestDispatcher rd = sc.getRequestDispatcher(requestReceiver);
51 rd.forward(req,res);
52 rd = null;
53 }
54
55
56 }