# HG changeset patch # User František Kučera # Date 1276948811 -7200 # Node ID 91c4282ea15fd22c38b869202527e25a09705327 # Parent 44ef544460ca012d6a03decf76d8acd8c6677c4f doladění CSS pro lidi bez JS diff -r 44ef544460ca -r 91c4282ea15f java/nekurak.net-web/src/java/cz/frantovo/nekurak/servlet/Komentare.java --- a/java/nekurak.net-web/src/java/cz/frantovo/nekurak/servlet/Komentare.java Sat Jun 19 11:19:27 2010 +0200 +++ b/java/nekurak.net-web/src/java/cz/frantovo/nekurak/servlet/Komentare.java Sat Jun 19 14:00:11 2010 +0200 @@ -27,17 +27,19 @@ protected void doPost(HttpServletRequest pozadavek, HttpServletResponse odpoved) throws ServletException, IOException { PodnikRemote ejb = hledac.getPodnikEJB(); + /** Načteme HTTP parametry */ Komentar k = new Komentar(); k.setPodnik(Integer.decode(pozadavek.getParameter("podnik"))); k.setNadpis(pozadavek.getParameter("nadpis")); k.setKomentar(pozadavek.getParameter("komentar")); k.setTyp(Komentar.TYP.valueOf(pozadavek.getParameter("typ"))); - boolean ulozit = Boolean.valueOf(pozadavek.getParameter("odeslat")); String jsp; + try { + /** Komentář odešleme do nižší vrstvy ke kontrole nebo rovnou k uložení */ k = ejb.komentuj(k, ulozit); pozadavek.setAttribute("komentar", k); @@ -47,10 +49,12 @@ jsp = "/WEB-INF/casti/ajaxKomentare/nahled.jsp"; } } catch (Exception e) { + /** Objekty mezi servletem a JSP si můžeme předávat pomocí atributů požadavku */ pozadavek.setAttribute("chyba", e); jsp = "/WEB-INF/casti/ajaxKomentare/chyba.jsp"; } + /** O vykreslení XHTML vyýstupu se už zase postará JSP */ RequestDispatcher rd = getServletContext().getRequestDispatcher(jsp); rd.forward(pozadavek, odpoved); } diff -r 44ef544460ca -r 91c4282ea15f java/nekurak.net-web/web/WEB-INF/casti/ajaxKomentare/nahled.jsp --- a/java/nekurak.net-web/web/WEB-INF/casti/ajaxKomentare/nahled.jsp Sat Jun 19 11:19:27 2010 +0200 +++ b/java/nekurak.net-web/web/WEB-INF/casti/ajaxKomentare/nahled.jsp Sat Jun 19 14:00:11 2010 +0200 @@ -6,8 +6,6 @@ xmlns:nk="urn:jsptagdir:/WEB-INF/tags/nekurak" version="2.0"> - -

:

diff -r 44ef544460ca -r 91c4282ea15f java/nekurak.net-web/web/WEB-INF/casti/ajaxKomentare/odeslano.jsp --- a/java/nekurak.net-web/web/WEB-INF/casti/ajaxKomentare/odeslano.jsp Sat Jun 19 11:19:27 2010 +0200 +++ b/java/nekurak.net-web/web/WEB-INF/casti/ajaxKomentare/odeslano.jsp Sat Jun 19 14:00:11 2010 +0200 @@ -6,8 +6,6 @@ xmlns:nk="urn:jsptagdir:/WEB-INF/tags/nekurak" version="2.0"> - -

:

diff -r 44ef544460ca -r 91c4282ea15f java/nekurak.net-web/web/WEB-INF/tags/nekurak/komentareVypis.tag --- a/java/nekurak.net-web/web/WEB-INF/tags/nekurak/komentareVypis.tag Sat Jun 19 11:19:27 2010 +0200 +++ b/java/nekurak.net-web/web/WEB-INF/tags/nekurak/komentareVypis.tag Sat Jun 19 14:00:11 2010 +0200 @@ -23,7 +23,7 @@

-