}
if (req.getParameter("removeLabel")!=null) {
//remove label
long labelId=Long.parseLong(req.getParameter("removeLabel"));
GameLabelHiber glh=GameLabelDao.findGameLabel(labelId, session);
g.getGameLabels().remove(glh);
GameDao.updateGame(g,session);
} else {
//apply label
if (req.getParameter("ApplyNewOne")!=null) {
//create new label
GameLabelHiber glh=new GameLabelHiber();
glh.setCreator(webUser.getId());
glh.setDescription(form.getDescription());
glh.setName(form.getName());
glh.setShared(form.isShared());
GameLabelDao.persistGameLabel(glh,session);
g.getGameLabels().add(glh);
GameDao.updateGame(g,session);
} else {
//apply existing label
GameLabelHiber glh=GameLabelDao.findGameLabel(Long.parseLong(req.getParameter("labelId")), session);
g.getGameLabels().add(glh);
GameDao.updateGame(g,session);
}
}