<%@page session="true"%> <%@ page import="com.edeal.frontline.navigation.FlRequest"%> <%@ page import="com.edeal.frontline.Utils"%> <% // With IE, json file upload requires using a form upload. // Unfortunaly using json content type will prompt user to download file ajax file and won't dispatch javascript "json is loaded event" // The following test avoid this behavior and allow IE json file upload String contentType = request.getContentType(); String userAgent = request.getHeader("User-Agent"); boolean isIE = userAgent != null && userAgent.contains("MSIE"); // If navigator is IE and resquest is a form file upload, we don't set json header if (!isIE || contentType==null || !contentType.contains("multipart/form-data")) response.setContentType("application/json"); final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); String json = flRequest.getRequestParameterOrAttribute("json"); %> { "json": "<%=json %>" }