public void init() {
        if (book == null && bookId != 0) {
            book = bookService.findBook(bookId);
        } else if (book == null && bookId == 0) {
            if (comics) {
                book = new Comics();
            } else {
                book = new Book();
            }
        }
        if (book == null) {
            try {
                FacesContext.getCurrentInstance().getExternalContext().redirect("error/404.xhtml");
            } catch (IOException ex) {
                log.log(Level.SEVERE, null, ex);
            }
        }
    }