title: Can i get Json raw data in an interceptor of struts 2?
body: <p>I want, sometimes, to log the raw data in struts2, but dont know where struts2 storage this info. (The bind of the json data to the beans work, i dont need that).</p>
  <p>I have an interceptor that inject functionality to the action and manage the exceptions to draw a log with info of the petition.</p>
  <p>The moment that i want to log the client send is when the server fail, in this manage of the error. But dont know where struts2 save the JSON. The other fields, like data of the struts invocation, values of the sesion, atributtes of the request, parameters of inputs... no problem. But the json data, i dont know where is.</p>
  <p>I send the JSON from Angular, using httpclient with an observable. Something like this:</p>
  <pre><code>/** POST: add a new hero to the server */
  addHero(hero: Hero): Observable&lt;Hero&gt; {
    return this.http.post&lt;Hero&gt;(this.heroesUrl, hero, this.httpOptions).pipe(
      tap((newHero: Hero) =&gt; this.log(`added hero w/ id=${newHero.id}`)),
      catchError(this.handleError&lt;Hero&gt;('addHero'))
    );
  }
  </code></pre>
  <p>Some code i use to get the log:</p>
  <pre><code>public static String getValoresRequestToString(HttpServletRequest request)
      {
          String retorno = &quot;&quot;;
          Enumeration&lt;String&gt; nombresAtributos = request.getAttributeNames();
          while (nombresAtributos.hasMoreElements())
          {
              String nombreAtributo = nombresAtributos.nextElement();
              retorno = retorno + &quot;\n&quot; + &quot;REQUEST:: &quot; + nombreAtributo + &quot; :&quot; + request.getAttribute(nombreAtributo);
          }
  
          return retorno;
      }
  
  public static String getValoresParametrosConfiguracionToString(ActionInvocation invocation)
      {
          ActionConfig config = invocation.getProxy().getConfig();
          Map&lt;String, String&gt; parameters = config.getParams();
          return UtilString.mapToString(parameters);
      }
  
  public static String getValoresParametrosToString(ActionInvocation invocation)
      {
          Map&lt;String, Object&gt; parametros = invocation.getInvocationContext().getParameters();
          return UtilString.mapToString(parametros);
      }
  </code></pre>