aboutsummaryrefslogtreecommitdiff
path: root/id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java
diff options
context:
space:
mode:
Diffstat (limited to 'id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java')
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java37
1 files changed, 16 insertions, 21 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java b/id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java
index 1dc1897b2..f33377547 100644
--- a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java
+++ b/id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java
@@ -1,17 +1,18 @@
package at.gv.egovernment.moa.id.auth.servlet;
import java.io.IOException;
-import java.io.PrintWriter;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
+import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import at.gv.egovernment.moa.id.auth.MOAIDAuthInitializer;
+import at.gv.egovernment.moa.id.util.HTTPRequestJSPForwarder;
import at.gv.egovernment.moa.id.util.MOAIDMessageProvider;
import at.gv.egovernment.moa.logging.Logger;
@@ -22,9 +23,6 @@ import at.gv.egovernment.moa.logging.Logger;
* @version $Id$
*/
public class ConfigurationServlet extends HttpServlet {
- /** Constant for the DTD-Doc type */
- private static final String DOC_TYPE =
- "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
/**
* Handle a HTTP GET request, used to indicated that the MOA
@@ -36,13 +34,7 @@ public class ConfigurationServlet extends HttpServlet {
throws ServletException, IOException {
MOAIDMessageProvider msg = MOAIDMessageProvider.getInstance();
- PrintWriter out;
- response.setContentType("text/html");
- out = response.getWriter();
- out.println(DOC_TYPE);
- out.println("<head><title>MOA configuration update</title></head>");
- out.println("<body bgcolor=\"#FFFFFF\">");
try {
MOAIDAuthInitializer.initialized=false;
MOAIDAuthInitializer.initialize();
@@ -50,21 +42,13 @@ public class ConfigurationServlet extends HttpServlet {
{ DateFormat.getTimeInstance(DateFormat.MEDIUM, Locale.GERMAN).format(new Date())} );
Logger.info(message);
- //TODO low-priority: change to ErrorPage
- out.println("<p><b>");
- out.println(message);
- out.println("</b></p>");
+ HTTPRequestJSPForwarder.forwardNamed(message, "/message-auth.jsp", getServletContext(), request, response);
+
} catch (Throwable t) {
String errorMessage = msg.getMessage("config.04", null);
Logger.error(errorMessage, t);
- out.println("<p><b>");
- out.println(errorMessage);
- out.println("</b></p>");
+ HTTPRequestJSPForwarder.forwardNamed(errorMessage, "/message-auth.jsp", getServletContext(), request, response);
}
- out.println("</body>");
-
- out.flush();
- out.close();
}
/**
@@ -77,4 +61,15 @@ public class ConfigurationServlet extends HttpServlet {
doGet(request, response);
}
+ /**
+ * Calls the web application initializer.
+ *
+ * @see javax.servlet.Servlet#init(ServletConfig)
+ */
+ public void init(ServletConfig servletConfig) throws ServletException {
+ super.init(servletConfig);
+ }
+
}
+
+