10_hangman/src/AbstractHangmanElement.java
import com.uwyn.rife.engine.Element;
import javax.servlet.http.HttpSession;
import model.Game;
import model.WordGenerator;
public abstract class AbstractHangmanElement extends Element {
public Game getGame() {
HttpSession session = getHttpServletRequest().getSession();
Game game = (Game)session.getAttribute("game");
if (null == game) {
game = new Game();
game.newGame(5, new WordGenerator());
session.setAttribute("game", game);
}
return game;
}
public boolean prohibitRawAccess() {
return false;
}
}