Ok, I read some stuff and made the following class:
package x;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.opensymphony.xwork2.interceptor.PreResultListener;
public class TemplatesDebugInterceptor extends AbstractInterceptor {
private static final long serialVersionUID = 4030044344066761593L;
Log log = LogFactory.getLog(TemplatesDebugInterceptor.class);
@Override
public String intercept(ActionInvocation invocation) throws Exception {
try {
if (ServletActionContext.getActionMapping() != null) {
String className = invocation.getAction().getClass().getCanonicalName();
String methodName = ServletActionContext.getActionMapping().getMethod();
log.info("===========================");
log.info(className+"."+methodName);
}
invocation.addPreResultListener(new PreResultListener() {
public void beforeResult(ActionInvocation invocation,String resultCode) {
Map<String, ResultConfig> resultsMap = invocation.getProxy().getConfig().getResults();
ResultConfig finalResultConfig = resultsMap.get(resultCode);
log.info(finalResultConfig.getParams());
}
});
} catch (Exception e) {
log.error("[ERROR] Could not list templates: ", e);
}
return invocation.invoke();
}
}
Added this to struts.xml:
<interceptors>
<interceptor name="templates" class="x.TemplatesDebugInterceptor" />
(...)
<interceptor-stack name="defaultStackBizgov">
<interceptor-ref name="templates"/>
(...)
And it's done!:
13:52:00,279 INFO [STDOUT] [INFO] (http-0.0.0.0-8080-7) TemplatesDebugInterceptor - x.ProcedureDetailsAction.validateSubmitPublication
13:52:00,357 INFO [STDOUT] [INFO] (http-0.0.0.0-8080-7) TemplatesDebugInterceptor - {location=/WEB-INF/jsp/indexPage.jsp}
13:52:00,763 INFO [STDOUT] [INFO] (http-0.0.0.0-8080-7) TemplatesDebugInterceptor - {location=/WEB-INF/jsp/publicationView.jsp}
I will update this post if I find out some extra useful output.