<commit_before><commit_msg>first deposit for release 1.0<commit_after>package gov.nih.nci.calab.ui.core;

import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.tiles.TilesRequestProcessor;
 
/**
 * 
 * This class extends the default Tiles RequesetProcessor to check and make sure session is not expired
 * before every request.  This is useful for directing requests to the log in page when action forms involve 
 * indexed properties and session is expired.
 * 
 * @author pansu
 */
public class CustomRequestProcessor extends TilesRequestProcessor {
	protected ActionForm processActionForm(
			javax.servlet.http.HttpServletRequest request,
			javax.servlet.http.HttpServletResponse response,
			ActionMapping mapping) {
		HttpSession session = request.getSession(false);
		if (session == null || session != null
				&& session.getAttribute("user") == null
				&& !request.getServletPath().equals("/login.do")) {
			return null;
		} else {
			return super.processActionForm(request, response, mapping);
		}		
	}
}
{'fraction_non_alphanumeric': 0.09489704565801253, 'fraction_numerical': 0.0017905102954341987, 'mean_word_length': 4.618090452261306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4261539', 'n_tokens_mistral': 333, 'n_tokens_neox': 306, 'n_words': 88}