Rev 1945 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
58 | jmachado | 1 | package pt.estgp.estgweb.web.controllers; |
2 | |||
3 | import org.apache.log4j.Logger; |
||
4 | import org.apache.struts.action.*; |
||
5 | import pt.estgp.estgweb.web.utils.RequestUtils; |
||
6 | import pt.estgp.estgweb.web.form.TesteForm; |
||
7 | import pt.utl.ist.berserk.logic.serviceManager.IServiceManager; |
||
8 | import pt.utl.ist.berserk.logic.serviceManager.ServiceManager; |
||
9 | |||
10 | import javax.servlet.http.HttpServletRequest; |
||
11 | import javax.servlet.http.HttpServletResponse; |
||
12 | import javax.servlet.ServletException; |
||
13 | import java.io.IOException; |
||
14 | |||
15 | /** |
||
16 | * @author Jorge Machado |
||
17 | * @date 26/Fev/2008 |
||
18 | * @time 18:01:54 |
||
19 | * @see pt.estgp.estgweb.web |
||
20 | */ |
||
21 | public class TesteController extends ApplicationDispatchController |
||
22 | { |
||
23 | |||
24 | 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(TesteController.class); |
||
25 | |||
26 | public ActionForward save(ActionMapping mapping, |
||
27 | ActionForm form , |
||
28 | HttpServletRequest request, |
||
29 | HttpServletResponse response) |
||
30 | throws 1.5.0/docs/api/java/io/IOException.html">IOException, ServletException |
||
31 | { |
||
32 | |||
33 | |||
34 | TesteForm tf = (TesteForm) form; |
||
35 | 5+0%2Fdocs%2Fapi+Object">Object[] args2 = {tf.getTeste()}; |
||
36 | IServiceManager sm = null; |
||
37 | try |
||
38 | { |
||
39 | sm = ServiceManager.getInstance(); |
||
40 | } |
||
41 | catch (1.5.0/docs/api/java/lang/Exception.html">Exception e) |
||
42 | { |
||
43 | logger.error(e); |
||
44 | } |
||
45 | try |
||
46 | { |
||
142 | jmachado | 47 | sm.execute(RequestUtils.getRequester(request, response), "TesteSaver", args2); |
58 | jmachado | 48 | } |
49 | catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e) |
||
50 | { |
||
51 | 1.5.0/docs/api/java/lang/System.html">System.out.println("Already exist fail creation, gone login now"); |
||
52 | } |
||
53 | return mapping.findForward("ok"); |
||
54 | |||
55 | } |
||
56 | |||
57 | |||
58 | } |