HttpServletRequest request, HttpServletResponse response)
throws Exception {
if (log.isDebugEnabled()) {
log.debug("init method called");
}
GlobalFilter globalFilter;
IntFilter intFilter;
DynaActionForm filterForm = (DynaActionForm) form;
String globalFilterValue = request.getParameter("val");
// Initialisation du filtre global
if (globalFilterValue == null || "".equals(globalFilterValue)) {
// Aucun filtre n'�tait pass� en param�tre
globalFilter = new GlobalFilter();
intFilter = new IntFilter();
globalFilter.save(intFilter);
} else {
// Test de la validit� du filtre
String result = filterService.validateFilter(globalFilterValue);
// Si la cha�ne est vide, le filtre est invalide
if (result.equals("")) {
globalFilter = new GlobalFilter();
intFilter = new IntFilter();
globalFilter.save(intFilter);
} else { // La valeur du filtre est valide
globalFilter = new GlobalFilter();
globalFilter.init(globalFilterValue, result);
intFilter = globalFilter.getFirst();
}
}
filterForm.set(ConsoleCst.GLOBALFILTER, globalFilter);
filterForm.set(ConsoleCst.INTFILTER, intFilter);
request.getSession().setAttribute(ConsoleCst.INTFILTER_SESSION_BEAN,
globalFilter.getFilterList());
request.getSession().setAttribute(ConsoleCst.FILTER_SESSION_BEAN,
intFilter.getFilterList());
request.getSession()
.setAttribute(ConsoleCst.GLOBALFILTER, globalFilter);
request.getSession().setAttribute(ConsoleCst.INTFILTER, intFilter);