Registrace uživatelů. TODO:
- hashovat heslo, aby se mohl přihlásit
- generovat náhodný token (csrf)
1 package cz.frantovo.nekurak.web;
3 import cz.frantovo.nekurak.ejb.PodnikRemote;
4 import cz.frantovo.nekurak.ejb.UzivatelRemote;
5 import java.io.Serializable;
6 import java.util.logging.Level;
7 import java.util.logging.Logger;
8 import javax.naming.Context;
9 import javax.naming.InitialContext;
10 import javax.naming.NamingException;
16 public class HledacSluzby implements Serializable {
18 private PodnikRemote podnikEJB;
19 private UzivatelRemote uzivatelEJB;
20 private static final Logger log = Logger.getLogger(HledacSluzby.class.getSimpleName());
22 public PodnikRemote getPodnikEJB() {
23 if (podnikEJB == null) {
25 Context c = new InitialContext();
26 podnikEJB = (PodnikRemote) c.lookup("cz.frantovo.nekurak.ejb.PodnikRemote");
27 } catch (NamingException e) {
28 log.log(Level.SEVERE, "Chyba při hledání PodnikRemote", e);
29 throw new RuntimeException(e);
35 public UzivatelRemote getUzivatelEJB() {
36 if (uzivatelEJB == null) {
38 Context c = new InitialContext();
39 uzivatelEJB = (UzivatelRemote) c.lookup("cz.frantovo.nekurak.ejb.UzivatelRemote");
40 } catch (NamingException e) {
41 log.log(Level.SEVERE, "Chyba při hledání UzivatelRemote", e);
42 throw new RuntimeException(e);