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.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.MOAIDMessageProvider; import at.gv.egovernment.moa.logging.Logger; /** * Servlet requested for updating the MOA-ID Auth configuration from configuration file * * @author Paul Ivancsics * @version $Id$ */ public class ConfigurationServlet extends HttpServlet { /** Constant for the DTD-Doc type */ private static final String DOC_TYPE = "\n"; /** * Handle a HTTP GET request, used to indicated that the MOA * configuration needs to be updated (reloaded). * * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { MOAIDMessageProvider msg = MOAIDMessageProvider.getInstance(); PrintWriter out; response.setContentType("text/html"); out = response.getWriter(); out.println(DOC_TYPE); out.println("
"); out.println(message); out.println("
"); } catch (Throwable t) { String errorMessage = msg.getMessage("config.04", null); Logger.error(errorMessage, t); out.println(""); out.println(errorMessage); out.println("
"); } out.println(""); out.flush(); out.close(); } /** * Do the same asdoGet
.
*
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse)
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}