1 package org
.argeo
.slc
.web
.ajaxplorer
;
4 import java
.util
.TreeMap
;
6 import javax
.servlet
.http
.HttpServletRequest
;
8 import org
.apache
.commons
.logging
.Log
;
9 import org
.apache
.commons
.logging
.LogFactory
;
11 public class SimpleAjxpDriver
implements AjxpDriver
{
12 protected final Log log
= LogFactory
.getLog(getClass());
13 private Map
<String
, AjxpAction
<?
extends AjxpDriver
>> actions
= new TreeMap
<String
, AjxpAction
<?
extends AjxpDriver
>>();
15 public AjxpAnswer
executeAction(HttpServletRequest request
) {
16 String actionStr
= request
.getParameter("get_action");
17 if (actionStr
== null) {
18 actionStr
= request
.getParameter("action");
20 if (!actions
.containsKey(actionStr
)) {
21 throw new AjxpDriverException("Action " + actionStr
24 AjxpAction action
= actions
.get(actionStr
);
25 return action
.execute(this,request
);
28 public void setActions(Map
<String
, AjxpAction
<?
extends AjxpDriver
>> actions
) {
29 this.actions
= actions
;