catch (InvocationTargetException e) { handleError( res,res.getWriter(), "ServletModule" + moduleName + " target not found."); }
catch (ClassNotFoundException e) { handleError(res, res.getWriter(), "ServletModule" + moduleName + " not found."); }
catch (IllegalArgumentException e) { handleError( res,res.getWriter(), "ServletModule" + moduleName + " not found."); }
+ catch (ServletModuleUserException e) {
+ handleUserError(res,res.getWriter(), e.getMsg());
+ }
catch (ServletModuleException e){ handleError(res,res.getWriter(), "ServletException in Module ServletModule" + moduleName + " -- " + e.toString()); }
catch (IllegalAccessException e){
handleError(res,res.getWriter(), "No access to class ServletModule" + moduleName + " -- " + e.toString()); }
}
}
+ private void handleUserError(HttpServletResponse res,PrintWriter out, String errorString) {
+
+ try {
+ theLog.printError(errorString);
+ SimpleHash modelRoot = new SimpleHash();
+ modelRoot.put("errorstring", new SimpleScalar(errorString));
+ modelRoot.put("date", new SimpleScalar(StringUtil.date2readableDateTime(new GregorianCalendar())));
+ HTMLTemplateProcessor.process(res,MirConfig.getProp("Mir.UserErrorTemplate"),modelRoot,out);
+ out.close();
+ }
+ catch (Exception e) {
+ System.err.println("Fehler in UserErrorTemplate");
+ }
+
+ }
/**
* evaluate login for user / password
*/