0

我有一个带有通配符 y 的操作我想在拦截器中访问这个变量

行动

  @Action(value="{uri}/page",
        results={
            @Result(name=SUCCESS,location="/success.jsp"),
            }
        )
  public String execute(){
    ...

拦截器

  public String intercept(ActionInvocation actionInvocation) throws Exception {
         // =( uri is not in the map
        Map<String, Object> params =
              actionInvocation.getInvocationContext().getContextMap();
   ...

我在拦截器中找不到通配符的位置

编辑:

我只是找到如何:

   public String intercept(ActionInvocation actionInvocation) throws Exception {
         ActionConfig config = actionInvocation.getProxy().getConfig();
         log.info(config.getParams().get("uri"));
4

1 回答 1

0

我只是找到如何:

  public String intercept(ActionInvocation actionInvocation) throws Exception {
     ActionConfig config = actionInvocation.getProxy().getConfig();
     log.info(config.getParams().get("uri"));

我可以做类似的事情

本地主机/站点/campus1/page.action

本地主机/站点/campus2/page.action

拦截器决定“校园”是否存在

于 2012-06-05T02:37:45.777 回答