* Dispatcher, calls the method passed to ServletModule Class, through the "do"
* Parameter (via POST or GET)
*
- * @version $Id: ServletModuleDispatch.java,v 1.15.2.1 2003/09/03 17:49:38 zapata Exp $
- *
- * @Author rk
+ * @version $Id: ServletModuleDispatch.java,v 1.15.2.3 2005/07/27 11:46:14 grok Exp $
*
+ * @author rk
*/
public final class ServletModuleDispatch {
* @param aRequest
* @param aResponse
* @throws ServletModuleExc
- * @throws ServletModuleUserExc
* @throws ServletModuleFailure
*/
public static void dispatch(ServletModule aServletModule, HttpServletRequest aRequest,
- HttpServletResponse aResponse) throws ServletModuleExc, ServletModuleUserExc, ServletModuleFailure
- {
+ HttpServletResponse aResponse) throws ServletModuleExc, ServletModuleFailure {
+ // look for requested method's name in the "do" http request param,
+ // if not present, use default action
String doParam = aRequest.getParameter("do");
- logger.info("ServletModuleDispatch: " + aServletModule.toString() + " with method " + doParam);
+ logger.debug("ServletModuleDispatch: " + aServletModule.toString() + " with method " + doParam);
+
if (doParam == null) {
if (aServletModule.defaultAction() != null)
doParam = aServletModule.defaultAction();
throw new ServletModuleExc("no parameter do supplied!");
}
+ // ok, we have the method's name, now call it
try {
Method method = aServletModule.getClass().getMethod(doParam,SIGNATURE);
if (method != null) {