---
title: "action在request中返回的结果进行重新的处理"
author: "qinya06"
date: "2010-09-07T23:12:28Z"
tags: ["Java"]
categories: ["企业架构"]
slug: "action-request"
draft: false
lastmod: "2010-09-07T23:17:23Z"
id: 757950
url: "https://qinya.iteye.com/blog/757950"
---

userAction 
       private String name; 


userActionInterceptor 
    
        InterceptorMethod(){ 
                
               step_1: 得到当前拦截的action 
               step_2:  得到 action  properties  修改 
              
                  这样应该是没有问题的! 

       } 


<span style="color:red">Adding a PreResultListener</span>Accessing the ResultConfig Objects
If you need to work with the set of ResultConfigs before the Action executes, you can use an Interceptor to process the Map returned by getResults.


```java
public class MyInterceptor implements Interceptor {
  // ...
  public String intercept(ActionInvocation invocation) throws Exception {
    Map resultsMap = invocation.getProxy().getConfig().getResults();

      // do something with ResultConfig in map

    return invocation.invoke();
  }
  // ...
}
```

If you are writing against Java 5, you could use a generic when obtain the map.

```java

Map<String, ResultConfig> resultsMap = invocation.getProxy().getConfig().getResults();
```