Subversion Repositories bacoAlunos

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1885 grupo1 1
package pt.estgp.estgweb.web.controllers;
2
 
3
import org.apache.log4j.Logger;
4
 
5
import javax.servlet.ServletException;
6
import javax.servlet.http.HttpServlet;
7
import javax.servlet.http.HttpServletRequest;
8
import javax.servlet.http.HttpServletResponse;
9
import java.io.IOException;
10
import java.lang.reflect.InvocationTargetException;
11
 
12
public class TesteEngSoftServlet extends HttpServlet {
13
    private static final 1.5.0/docs/api/java/util/logging/Logger.html">Logger logger = 1.5.0/docs/api/java/util/logging/Logger.html">Logger.getLogger(TesteEngSoftServlet.class);
14
 
15
    @1.5.0/docs/api/java/lang/Override.html">Override
16
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, 1.5.0/docs/api/java/io/IOException.html">IOException {
17
        doPost(req, resp);
18
    }
19
 
20
    @1.5.0/docs/api/java/lang/Override.html">Override
21
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, 1.5.0/docs/api/java/io/IOException.html">IOException {
22
        1.5.0/docs/api/java/lang/String.html">String op = req.getParameter("dispatch");
23
 
24
        try {
25
            this.getClass()
26
                    .getMethod(op, new 1.5.0/docs/api/java/lang/Class.html">Class[]{HttpServletRequest.class, HttpServletResponse.class})
27
                    .invoke(this, req, resp);
28
        } catch (1.5.0/docs/api/java/lang/NoSuchMethodException.html">NoSuchMethodException e) {
29
            e.printStackTrace();
30
        } catch (1.5.0/docs/api/java/lang/IllegalAccessException.html">IllegalAccessException e) {
31
            e.printStackTrace();
32
        } catch (1.5.0/docs/api/java/lang/reflect/InvocationTargetException.html">InvocationTargetException e) {
33
            e.printStackTrace();
34
        }
35
 
36
    }
37
}