Rev 2009 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2009 | Rev 2049 | ||
---|---|---|---|
1 | package pt.estgp.es.exemplos.hibernate.web; |
1 | package pt.estgp.es.exemplos.hibernate.web; |
2 | 2 | ||
- | 3 | import pt.estgp.es.exemplos.hibernate.HibernateUtils; |
|
- | 4 | import pt.estgp.es.exemplos.hibernate.Pagina; |
|
- | 5 | import pt.estgp.es.exemplos.hibernate.Seccao; |
|
3 | import pt.estgp.es.exemplos.hibernate.services.ServicoPaginas; |
6 | import pt.estgp.es.exemplos.hibernate.services.ServicoPaginas; |
4 | 7 | ||
5 | import java.io.IOException; |
8 | import java.io.IOException; |
- | 9 | import java.util.ArrayList; |
|
6 | 10 | ||
7 | public class PaginasServlet extends javax.servlet.http.HttpServlet |
11 | public class PaginasServlet extends javax.servlet.http.HttpServlet |
8 | { |
12 | { |
9 | 13 | ||
10 | 14 | ||
11 | protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, 1.5.0/docs/api/java/io/IOException.html">IOException { |
15 | protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, 1.5.0/docs/api/java/io/IOException.html">IOException { |
12 | 16 | ||
13 | 1.5.0/docs/api/java/lang/String.html">String titulo = request.getParameter("titulo"); |
17 | 1.5.0/docs/api/java/lang/String.html">String titulo = request.getParameter("titulo"); |
14 | 1.5.0/docs/api/java/lang/String.html">String idPagina = request.getParameter("idPagina"); |
18 | 1.5.0/docs/api/java/lang/String.html">String idPagina = request.getParameter("idPagina"); |
15 | 19 | ||
16 | 20 | ||
17 | 21 | ||
18 | new ServicoPaginas().criaSeccaoService(idPagina,titulo); |
22 | new ServicoPaginas().criaSeccaoService(idPagina,titulo); |
19 | 23 | ||
20 | 24 | ||
21 | //SO TEM ISTO |
25 | //SO TEM ISTO |
22 | //new ServicoPaginas().criaSeccaoService(idPagina,titulo); |
26 | //new ServicoPaginas().criaSeccaoService(idPagina,titulo); |
23 | 27 | ||
24 | 28 | ||
25 | request.setAttribute("id",new 1.5.0/docs/api/java/lang/Long.html">Long(idPagina)); |
29 | request.setAttribute("id",new 1.5.0/docs/api/java/lang/Long.html">Long(idPagina)); |
26 | 30 | ||
27 | request.getRequestDispatcher("apresentaPagina.jsp").forward(request,response); |
31 | request.getRequestDispatcher("apresentaPagina.jsp").forward(request,response); |
28 | } |
32 | } |
29 | 33 | ||
30 | protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, 1.5.0/docs/api/java/io/IOException.html">IOException { |
34 | protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, 1.5.0/docs/api/java/io/IOException.html">IOException { |
31 | doPost(request,response); |
35 | doPost(request,response); |
32 | } |
36 | } |
33 | 37 | ||
34 | } |
38 | } |
35 | 39 |