Commit 05cda902 authored by Michael Ritter's avatar Michael Ritter

Set ContentType for json/csv requests (in the proper location this time)

parent 02d3a9a1
......@@ -212,10 +212,8 @@ public class StatusServlet extends EntityManagerServlet {
request.setAttribute(PAGE_NUMBER, pb);
request.setAttribute("groups", GroupSummaryContext.summaries);
if (hasJson(request)) {
response.setContentType("application/json");
dispatcher = request.getRequestDispatcher("status-json.jsp");
} else if (hasCsv(request)) {
response.setContentType("text/csv");
dispatcher = request.getRequestDispatcher("status-csv.jsp");
} else {
dispatcher = request.getRequestDispatcher("status.jsp");
......
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%@page contentType="text/plain" pageEncoding="UTF-8"%>id,name,group,directory,last sync,storage,check period,proxy enabled,audit tokens,state,total files,total size,total errors,missing tokens,missing files,active files,corrupt files,invalid digests,remote missing files,remote corrupt files
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%@page contentType="text/csv" pageEncoding="UTF-8"%>id,name,group,directory,last sync,storage,check period,proxy enabled,audit tokens,state,total files,total size,total errors,missing tokens,missing files,active files,corrupt files,invalid digests,remote missing files,remote corrupt files
<c:forEach items="${collections}" var="item">${item.collection.id},${item.collection.name},${item.collection.group},${item.collection.directory},${item.collection.lastSync},${item.collection.storage},${item.collection.settings['audit.period']},${item.collection.settings['proxy.data']},${item.collection.settings['audit.tokens']},${item.collection.state},${item.totalFiles},${item.totalSize},${item.totalErrors < 0 ? 0 : item.totalErrors},${item.missingTokens < 0 ? 0 : item.missingTokens},${item.missingFiles < 0 ? 0 : item.missingFiles},${item.activeFiles < 0 ? 0 : item.activeFiles},${item.corruptFiles < 0 ? 0 : item.corruptFiles},${item.invalidDigests < 0 ? 0 : item.invalidDigests},${item.remoteMissing < 0 ? 0 : item.remoteMissing},${item.remoteCorrupt < 0 ? 0 : item.remoteCorrupt}
</c:forEach>
\ No newline at end of file
<%@taglib prefix="json" uri="http://www.atg.com/taglibs/json" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page contentType="text/plain" pageEncoding="UTF-8"%>
<%@page contentType="application/json" pageEncoding="UTF-8"%>
<json:object>
<json:property name="startup_complete" value="${startup_complete}"/>
<json:property name="paused" value="${pause.paused}"/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment