/**
 * Licensed under the MICE s.r.l.
 * End User License Agreement
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.micegroup.it/voila/license.html
 */
package it.mice.voila.runtime.web.util;

import javax.servlet.http.HttpSession;

/**
 * @author ZZY9V4
 *
 * To change this generated comment edit the template variable "typecomment":
 * Window>Preferences>Java>Templates.
 * To enable and disable the creation of type comments go to
 * Window>Preferences>Java>Code Generation.
 */
public class SessionUtil {
	@SuppressWarnings("unchecked")
	public static void resetSession(HttpSession session) {
		java.util.Enumeration<String> sessionElm = session.getAttributeNames();
		while(sessionElm.hasMoreElements()){
			String name =(String) sessionElm.nextElement();
			if(name.endsWith("Form") || name.endsWith("Filter")){
				session.removeAttribute(name);	
			}
		}
	}

}
