X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=source%2Fmir%2Fservlet%2FServletModuleDispatch.java;h=a8efff348d82200ed0ad2ad7db74836893a5f740;hb=a81731a9c8eb300743f905a46773b9afc9178cbb;hp=8490f10ccdbd48274434160e93476dd874b6a7a0;hpb=84b43b6a792e625a3dc8fcc1c80bb601a9a2422b;p=mir.git
diff --git a/source/mir/servlet/ServletModuleDispatch.java b/source/mir/servlet/ServletModuleDispatch.java
index 8490f10c..a8efff34 100755
--- a/source/mir/servlet/ServletModuleDispatch.java
+++ b/source/mir/servlet/ServletModuleDispatch.java
@@ -16,60 +16,60 @@ import mir.misc.*;
*/
public final class ServletModuleDispatch {
- static Logfile theLog;
+ static Logfile theLog;
- static {
- theLog = Logfile.getInstance("/tmp/smod.dispatch");
- }
+ static {
+ theLog = Logfile.getInstance("/tmp/smod.dispatch");
+ }
- /**
- * privater Konstruktor, um versehentliche Instantiierung zu verhindern
- */
- private ServletModuleDispatch () {
- }
+ /**
+ * privater Konstruktor, um versehentliche Instantiierung zu verhindern
+ */
+ private ServletModuleDispatch () {
+ }
- /**
- * Die Dispatch-Routine ruft das von dem Hauptservlet kommende ServletModule
- * mit dem per HttpServletRequest angegebenen Paramter do
auf.
- * Ist kein Parameter angegeben, so wird versucht, in die defaultAction
- * des ServletModules zu springen.
- *
- * @param req Http-Request, das vom Dispatcher an die Methode des
- * ServletModules durchgereicht wird
- * @param res Http-Response, die vom Dispatcher an die Methode des
- * ServletModules durchgereicht wird
- * @param sMod ServletModule, an das dispatched wird.
- * @param mod Name des Modules als String (für Logfile)
- */
+ /**
+ * Die Dispatch-Routine ruft das von dem Hauptservlet kommende ServletModule
+ * mit dem per HttpServletRequest angegebenen Paramter do
auf.
+ * Ist kein Parameter angegeben, so wird versucht, in die defaultAction
+ * des ServletModules zu springen.
+ *
+ * @param req Http-Request, das vom Dispatcher an die Methode des
+ * ServletModules durchgereicht wird
+ * @param res Http-Response, die vom Dispatcher an die Methode des
+ * ServletModules durchgereicht wird
+ * @param sMod ServletModule, an das dispatched wird.
+ * @param mod Name des Modules als String (für Logfile)
+ */
- public static void dispatch(ServletModule sMod, HttpServletRequest req,
- HttpServletResponse res) throws ServletModuleException
- {
- //sMod.predeliver(req,res);
+ public static void dispatch(ServletModule sMod, HttpServletRequest req,
+ HttpServletResponse res) throws ServletModuleException
+ {
+ //sMod.predeliver(req,res);
- String doParam = req.getParameter("do");
- theLog.printInfo("SerletModuleDispatch: " + sMod.toString() + " with method " + doParam);
- if (doParam == null) {
- if (sMod.defaultAction() != null) doParam = sMod.defaultAction();
- else throw new ServletModuleException("no parameter do supplied!");
- }
+ String doParam = req.getParameter("do");
+ theLog.printInfo("SerletModuleDispatch: " + sMod.toString() + " with method " + doParam);
+ if (doParam == null) {
+ if (sMod.defaultAction() != null) doParam = sMod.defaultAction();
+ else throw new ServletModuleException("no parameter do supplied!");
+ }
- Class[] params= { HttpServletRequest.class, HttpServletResponse.class};
+ Class[] params= { HttpServletRequest.class, HttpServletResponse.class};
- try {
- Method method = sMod.getClass().getMethod(doParam,params);
- if (method != null) {
- method.invoke(sMod,new Object[] {req,res} );
- return;
- }
- else theLog.printDebugInfo("method lookup unsuccesful");
- }
- catch ( NoSuchMethodException e) { throw new ServletModuleException("no such method!" + e.toString());}
- catch ( SecurityException e) { throw new ServletModuleException("method not allowed!" + e.toString());}
- catch ( InvocationTargetException e) {throw new ServletModuleException("target method exception!" + e.getTargetException().toString());}
- catch ( IllegalAccessException e) { throw new ServletModuleException("illegal method not allowed!" + e.toString());}
-// catch ( Exception e ) { throw new ServletModuleException(e.toString()); }
+ try {
+ Method method = sMod.getClass().getMethod(doParam,params);
+ if (method != null) {
+ method.invoke(sMod,new Object[] {req,res} );
+ return;
+ }
+ else theLog.printDebugInfo("method lookup unsuccesful");
+ }
+ catch ( NoSuchMethodException e) { throw new ServletModuleException("no such method!" + e.toString());}
+ catch ( SecurityException e) { throw new ServletModuleException("method not allowed!" + e.toString());}
+ catch ( InvocationTargetException e) {e.printStackTrace();throw new ServletModuleException("target method exception!" + e.getTargetException().toString());}
+ catch ( IllegalAccessException e) { throw new ServletModuleException("illegal method not allowed!" + e.toString());}
+// catch ( Exception e ) { throw new ServletModuleException(e.toString()); }
- throw new ServletModuleException("delivery failed! -- ");
- }
-}
\ No newline at end of file
+ throw new ServletModuleException("delivery failed! -- ");
+ }
+}