static Logfile theLog;
static {
- theLog = Logfile.getInstance("ServletModuleDispatch");
+ theLog = Logfile.getInstance("/tmp/smod.dispatch");
}
/**
*/
public static void dispatch(ServletModule sMod, HttpServletRequest req,
- HttpServletResponse res) throws ServletModuleException
+ HttpServletResponse res) throws ServletModuleException, ServletModuleUserException
{
//sMod.predeliver(req,res);
}
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 ( InvocationTargetException e) {
+ if (e.getTargetException().getClass().getName() == "mir.servlet.ServletModuleUserException") {
+ throw new ServletModuleUserException(((ServletModuleUserException)e.getTargetException()).getMsg());
+ } else {
+ e.printStackTrace();
+ throw new ServletModuleException(e.getTargetException().toString());
+ }
+ }
catch ( IllegalAccessException e) { throw new ServletModuleException("illegal method not allowed!" + e.toString());}
-// catch ( Exception e ) { throw new ServletModuleException(e.toString()); }
+ //catch ( ServletModuleException e ) { throw new ServletModuleException(e.toString()); }
throw new ServletModuleException("delivery failed! -- ");
}