1.1 --- a/java/nekurak.net-web/src/java/cz/frantovo/nekurak/servlet/Komentare.java Sat Jun 19 11:19:27 2010 +0200
1.2 +++ b/java/nekurak.net-web/src/java/cz/frantovo/nekurak/servlet/Komentare.java Sat Jun 19 14:00:11 2010 +0200
1.3 @@ -27,17 +27,19 @@
1.4 protected void doPost(HttpServletRequest pozadavek, HttpServletResponse odpoved) throws ServletException, IOException {
1.5 PodnikRemote ejb = hledac.getPodnikEJB();
1.6
1.7 + /** Načteme HTTP parametry */
1.8 Komentar k = new Komentar();
1.9 k.setPodnik(Integer.decode(pozadavek.getParameter("podnik")));
1.10 k.setNadpis(pozadavek.getParameter("nadpis"));
1.11 k.setKomentar(pozadavek.getParameter("komentar"));
1.12 k.setTyp(Komentar.TYP.valueOf(pozadavek.getParameter("typ")));
1.13 -
1.14 boolean ulozit = Boolean.valueOf(pozadavek.getParameter("odeslat"));
1.15
1.16 String jsp;
1.17
1.18 +
1.19 try {
1.20 + /** Komentář odešleme do nižší vrstvy ke kontrole nebo rovnou k uložení */
1.21 k = ejb.komentuj(k, ulozit);
1.22 pozadavek.setAttribute("komentar", k);
1.23
1.24 @@ -47,10 +49,12 @@
1.25 jsp = "/WEB-INF/casti/ajaxKomentare/nahled.jsp";
1.26 }
1.27 } catch (Exception e) {
1.28 + /** Objekty mezi servletem a JSP si můžeme předávat pomocí atributů požadavku */
1.29 pozadavek.setAttribute("chyba", e);
1.30 jsp = "/WEB-INF/casti/ajaxKomentare/chyba.jsp";
1.31 }
1.32
1.33 + /** O vykreslení XHTML vyýstupu se už zase postará JSP */
1.34 RequestDispatcher rd = getServletContext().getRequestDispatcher(jsp);
1.35 rd.forward(pozadavek, odpoved);
1.36 }
2.1 --- a/java/nekurak.net-web/web/WEB-INF/casti/ajaxKomentare/nahled.jsp Sat Jun 19 11:19:27 2010 +0200
2.2 +++ b/java/nekurak.net-web/web/WEB-INF/casti/ajaxKomentare/nahled.jsp Sat Jun 19 14:00:11 2010 +0200
2.3 @@ -6,8 +6,6 @@
2.4 xmlns:nk="urn:jsptagdir:/WEB-INF/tags/nekurak"
2.5 version="2.0">
2.6
2.7 -
2.8 -
2.9 <div>
2.10 <p class="informacniHlaska"><fmt:message key="komentare.nahledNadpis"/>:</p>
2.11 <!-- XHTML je už zkontrolované: -->
3.1 --- a/java/nekurak.net-web/web/WEB-INF/casti/ajaxKomentare/odeslano.jsp Sat Jun 19 11:19:27 2010 +0200
3.2 +++ b/java/nekurak.net-web/web/WEB-INF/casti/ajaxKomentare/odeslano.jsp Sat Jun 19 14:00:11 2010 +0200
3.3 @@ -6,8 +6,6 @@
3.4 xmlns:nk="urn:jsptagdir:/WEB-INF/tags/nekurak"
3.5 version="2.0">
3.6
3.7 -
3.8 -
3.9 <div>
3.10 <p class="informacniHlaska"><fmt:message key="komentare.nahledOdeslano"/>:</p>
3.11 <!-- XHTML je už zkontrolované: -->
4.1 --- a/java/nekurak.net-web/web/WEB-INF/tags/nekurak/komentareVypis.tag Sat Jun 19 11:19:27 2010 +0200
4.2 +++ b/java/nekurak.net-web/web/WEB-INF/tags/nekurak/komentareVypis.tag Sat Jun 19 14:00:11 2010 +0200
4.3 @@ -23,7 +23,7 @@
4.4 </c:when>
4.5 <c:otherwise>
4.6 <p><a href="javascript:komentare.zobrazFormular()"><fmt:message key="komentare.komentovat"/></a></p>
4.7 - <div id="formularKomentuj" style="display: none;">
4.8 + <div id="formularKomentuj">
4.9 <form method="post" action="?akce=odeslatKomentar" onsubmit="javascript:komentare.odeslat(); return false;">
4.10 <fieldset>
4.11 <input type="hidden" name="podnik" maxlength="255" value="${podnik.id}"/>
4.12 @@ -37,13 +37,17 @@
4.13 <option value="TEXY"><fmt:message key="komentar.typ.texy"/></option>
4.14 </select>
4.15 <br/>
4.16 - <button value="ano" name="nahled" onclick="javascript:komentare.nahled(); return false;"><fmt:message key="komentare.tlacitkoNahled"/></button>
4.17 + <button style="display: none;" id="tlacitkoNahled" onclick="javascript:komentare.nahled(); return false;"><fmt:message key="komentare.tlacitkoNahled"/></button>
4.18 <button value="submit"><fmt:message key="komentare.tlacitkoOdeslat"/></button>
4.19 </fieldset>
4.20 </form>
4.21 <div class="vystup"></div>
4.22 <div class="cistic"/>
4.23 </div>
4.24 + <script type="text/javascript">
4.25 + $("#formularKomentuj").css("display", "none");
4.26 + $("#tlacitkoNahled").css("display", "inline");
4.27 + </script>
4.28 </c:otherwise>
4.29 </c:choose>
4.30
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/java/nekurak.net-ws/nbproject/jaxws-build.xml Sat Jun 19 14:00:11 2010 +0200
5.3 @@ -0,0 +1,37 @@
5.4 +<?xml version="1.0" encoding="UTF-8"?>
5.5 +<!--
5.6 + *** GENERATED FROM jax-ws.xml - DO NOT EDIT ! ***
5.7 + *** TO MODIFY wsimport options USE Web Service node -> Edit WS Attributes ***
5.8 + *** TO CHANGE TARGETS GENERATED TO jaxws-build.xml COPY THOSE ***
5.9 + *** TARGETS TO ../build.xml AND MODIFY THAT FILE INSTEAD ***
5.10 +
5.11 + -->
5.12 +<project xmlns:xalan="http://xml.apache.org/xslt" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:jaxws="http://www.netbeans.org/ns/jax-ws/1">
5.13 + <!--
5.14 + ===================
5.15 + JAX-WS WSGEN SECTION
5.16 + ===================
5.17 + -->
5.18 + <target name="wsgen-init" depends="init, -do-compile">
5.19 + <mkdir dir="${build.generated.sources.dir}/jax-ws/resources/"/>
5.20 + <mkdir dir="${build.classes.dir}"/>
5.21 + <taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen">
5.22 + <classpath path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}"/>
5.23 + </taskdef>
5.24 + </target>
5.25 + <target name="wsgen-Podnik" depends="wsgen-init">
5.26 + <wsgen sourcedestdir="${build.generated.sources.dir}/jax-ws" resourcedestdir="${build.generated.sources.dir}/jax-ws/resources/" destdir="${build.generated.sources.dir}/jax-ws" verbose="true" xendorsed="true" keep="true" genwsdl="true" sei="cz.frantovo.nekurak.ws.Podnik">
5.27 + <classpath path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}"/>
5.28 + </wsgen>
5.29 + </target>
5.30 + <target name="wsgen-Pokus" depends="wsgen-init">
5.31 + <wsgen sourcedestdir="${build.generated.sources.dir}/jax-ws" resourcedestdir="${build.generated.sources.dir}/jax-ws/resources/" destdir="${build.generated.sources.dir}/jax-ws" verbose="true" xendorsed="true" keep="true" genwsdl="true" sei="cz.frantovo.nekurak.ws.Pokus">
5.32 + <classpath path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}"/>
5.33 + </wsgen>
5.34 + </target>
5.35 + <!--
5.36 + ===================
5.37 + JAX-WS WSIMPORT SECTION
5.38 + ===================
5.39 + -->
5.40 +</project>