java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/OdeslatKomentar.java
changeset 132 1ca0d7fdbe51
parent 130 1bbff3f5181f
child 142 44ef544460ca
     1.1 --- a/java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/OdeslatKomentar.java	Tue Jun 08 09:09:17 2010 +0200
     1.2 +++ b/java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/OdeslatKomentar.java	Tue Jun 08 12:56:46 2010 +0200
     1.3 @@ -1,6 +1,9 @@
     1.4  package cz.frantovo.nekurak.web;
     1.5  
     1.6  import cz.frantovo.nekurak.dto.Komentar;
     1.7 +import cz.frantovo.nekurak.vyjimky.KomentarovaVyjimka;
     1.8 +import cz.frantovo.nekurak.vyjimky.TexyVyjimka;
     1.9 +import java.util.logging.Level;
    1.10  import java.util.logging.Logger;
    1.11  
    1.12  /**
    1.13 @@ -11,8 +14,18 @@
    1.14  
    1.15      private HledacSluzby hledac = new HledacSluzby();
    1.16      private static final Logger log = Logger.getLogger(OdeslatKomentar.class.getSimpleName());
    1.17 +    private boolean ok = false;
    1.18  
    1.19 -    public void setKomentar(Komentar k) {
    1.20 -	hledac.getPodnikEJB().komentuj(k);
    1.21 +    public void setKomentar(Komentar k) throws TexyVyjimka {
    1.22 +	try {
    1.23 +	    hledac.getPodnikEJB().komentuj(k);
    1.24 +	    ok = true;
    1.25 +	} catch (KomentarovaVyjimka e) {
    1.26 +	    log.log(Level.WARNING, "chyba při vkládání komentáře", e);
    1.27 +	}
    1.28 +    }
    1.29 +
    1.30 +    public boolean isOk() {
    1.31 +	return ok;
    1.32      }
    1.33  }