@EJB anotace v servletu
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 19 Jun 2010 14:37:11 +0200
changeset 1443ea50a264ce0
parent 143 91c4282ea15f
child 145 0efefbf5f8b6
@EJB anotace v servletu
java/nekurak.net-web/src/java/cz/frantovo/nekurak/servlet/Komentare.java
     1.1 --- a/java/nekurak.net-web/src/java/cz/frantovo/nekurak/servlet/Komentare.java	Sat Jun 19 14:00:11 2010 +0200
     1.2 +++ b/java/nekurak.net-web/src/java/cz/frantovo/nekurak/servlet/Komentare.java	Sat Jun 19 14:37:11 2010 +0200
     1.3 @@ -2,8 +2,8 @@
     1.4  
     1.5  import cz.frantovo.nekurak.dto.Komentar;
     1.6  import cz.frantovo.nekurak.ejb.PodnikRemote;
     1.7 -import cz.frantovo.nekurak.web.HledacSluzby;
     1.8  import java.io.IOException;
     1.9 +import javax.ejb.EJB;
    1.10  import javax.servlet.RequestDispatcher;
    1.11  import javax.servlet.ServletException;
    1.12  import javax.servlet.http.HttpServlet;
    1.13 @@ -16,7 +16,8 @@
    1.14   */
    1.15  public class Komentare extends HttpServlet {
    1.16  
    1.17 -    private HledacSluzby hledac = new HledacSluzby();
    1.18 +    @EJB
    1.19 +    PodnikRemote ejb;
    1.20  
    1.21      @Override
    1.22      protected void doGet(HttpServletRequest pozadavek, HttpServletResponse odpoved) throws ServletException, IOException {
    1.23 @@ -25,8 +26,6 @@
    1.24  
    1.25      @Override
    1.26      protected void doPost(HttpServletRequest pozadavek, HttpServletResponse odpoved) throws ServletException, IOException {
    1.27 -	PodnikRemote ejb = hledac.getPodnikEJB();
    1.28 -
    1.29  	/** Načteme HTTP parametry */
    1.30  	Komentar k = new Komentar();
    1.31  	k.setPodnik(Integer.decode(pozadavek.getParameter("podnik")));