aboutsummaryrefslogtreecommitdiff
path: root/id.server/src/at/gv/egovernment/moa/id/auth/servlet
diff options
context:
space:
mode:
authorrudolf <rudolf@d688527b-c9ab-4aba-bd8d-4036d912da1d>2004-03-15 16:07:52 +0000
committerrudolf <rudolf@d688527b-c9ab-4aba-bd8d-4036d912da1d>2004-03-15 16:07:52 +0000
commit56ed4518d7978c064af5f240494bf587136c93b0 (patch)
treef7d9a57b7915d3b269d2550c9282138b624efa57 /id.server/src/at/gv/egovernment/moa/id/auth/servlet
parent747a8963ec0ffde4c6883dd1c42ad758a88b084c (diff)
downloadmoa-id-spss-56ed4518d7978c064af5f240494bf587136c93b0.tar.gz
moa-id-spss-56ed4518d7978c064af5f240494bf587136c93b0.tar.bz2
moa-id-spss-56ed4518d7978c064af5f240494bf587136c93b0.zip
RSCH
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@99 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'id.server/src/at/gv/egovernment/moa/id/auth/servlet')
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java10
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java37
2 files changed, 21 insertions, 26 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java b/id.server/src/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java
index 6ff52bc4a..95878007e 100644
--- a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java
+++ b/id.server/src/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java
@@ -35,7 +35,7 @@ public class AuthServlet extends HttpServlet implements MOAIDAuthConstants {
* <ul>
* <li>Logs the error</li>
* <li>Places error message and exception thrown into the request
- * as request attributes (to be used by <code>"/errorpage.jsp"</code>)</li>
+ * as request attributes (to be used by <code>"/errorpage-auth.jsp"</code>)</li>
* <li>Sets HTTP status 500 (internal server error)</li>
* </ul>
*
@@ -59,9 +59,9 @@ public class AuthServlet extends HttpServlet implements MOAIDAuthConstants {
req.setAttribute("ExceptionThrown", exceptionThrown);
}
- //forward this to errorpage.jsp wher the HTML error page is generated
+ //forward this to errorpage-auth.jsp where the HTML error page is generated
ServletContext context = getServletContext();
- RequestDispatcher dispatcher = context.getRequestDispatcher("/errorpage.jsp");
+ RequestDispatcher dispatcher = context.getRequestDispatcher("/errorpage-auth.jsp");
try {
dispatcher.forward(req, resp);
} catch (ServletException e) {
@@ -80,9 +80,9 @@ public class AuthServlet extends HttpServlet implements MOAIDAuthConstants {
Logger.error(ex.toString());
req.setAttribute("WrongParameters", ex.getMessage());
- // forward this to errorpage.jsp where the HTML error page is generated
+ // forward this to errorpage-auth.jsp where the HTML error page is generated
ServletContext context = getServletContext();
- RequestDispatcher dispatcher = context.getRequestDispatcher("/errorpage.jsp");
+ RequestDispatcher dispatcher = context.getRequestDispatcher("/errorpage-auth.jsp");
try {
dispatcher.forward(req, resp);
} catch (ServletException e) {
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);
+ }
+
}
+
+