Commit fd217f83 authored by michael.simon's avatar michael.simon
Browse files

remove template servlet

parent 38de58f1
......@@ -103,12 +103,6 @@ public class SecurityFilter implements Filter {
HttpSession httpSession = request.getSession(false);
Boolean templated = false;
if (appConfig.getConfigValue(request.getServerName() + "_templated") != null &&
appConfig.getConfigValue(request.getServerName() + "_templated").equalsIgnoreCase("true")) {
templated = true;
}
if (logger.isTraceEnabled())
logger.trace("Prechain Session is: {}", httpSession);
......@@ -212,15 +206,7 @@ public class SecurityFilter implements Filter {
}
else {
/*
* Normal pages are handled here
*/
if (templated) {
request.getServletContext().getRequestDispatcher("/tpl" + path).forward(servletRequest, servletResponse);
}
else {
chain.doFilter(servletRequest, servletResponse);
}
chain.doFilter(servletRequest, servletResponse);
}
}
else
......
package edu.kit.scc.webreg.sec;
import java.io.IOException;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
@Named
@WebServlet(urlPatterns = {"/tpl/*"})
public class TemplateRendererServlet implements Servlet {
@Inject
private Logger logger;
@Override
public void init(ServletConfig config) throws ServletException {
}
@Override
public void service(ServletRequest servletRequest, ServletResponse servletResponse)
throws ServletException, IOException {
HttpServletRequest request = (HttpServletRequest) servletRequest;
HttpServletResponse response = (HttpServletResponse) servletResponse;
String context = request.getServletContext().getContextPath();
String path = request.getRequestURI().substring(
context.length());
logger.debug("Template requested context '{}' path '{}'", context, path);
}
@Override
public ServletConfig getServletConfig() {
return null;
}
@Override
public String getServletInfo() {
return null;
}
@Override
public void destroy() {
}
}
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