Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, I read some <a href="http://struts.apache.org/2.x/docs/can-we-access-an-actions-result.html" rel="nofollow noreferrer">stuff</a> and made the following class:</p> <pre><code>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&lt;String, ResultConfig&gt; 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(); } } </code></pre> <p>Added this to struts.xml:</p> <pre><code>&lt;interceptors&gt; &lt;interceptor name="templates" class="x.TemplatesDebugInterceptor" /&gt; (...) &lt;interceptor-stack name="defaultStackBizgov"&gt; &lt;interceptor-ref name="templates"/&gt; (...) </code></pre> <p>And it's done!:</p> <pre><code>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} </code></pre> <p>I will update this post if I find out some extra useful output.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload