Hi,

I am trying to implement a custom Interceptor to have a global custom 
"security" logger in my web app.

The target is to log all the datas sended to the server during update, save, 
delete etc... to have a custom logger for security reasons.

In case of GET and POST (query string param or form data without json object) : 
HttpParameters httpParameters = ActionContext.getContext().getParameters();
works fine.

But in case of json params in POST (request payload) the previous code doesn't 
works
when the params is serialize via : JSON.stringify(...)

code sample: 
jQuery.ajax({
        type: 'POST', 
        url: url, 
        data: JSON.stringify(data),
        dataType: 'json',
        async: false ,
        contentType: 'application/json; charset=utf-8',
        success: function(){
                 self.load();
        },
        error: function(data) {
                 if (data.responseText) {
                         var error = JSON.parse(data.responseText);
                 }
        }

My custom Interceptor is added at the end of my stack after the json 
interceptor like this :
        <interceptor-ref name="json">
                <param name="contentType">application/json</param>
        </interceptor-ref>
        <interceptor-ref name="commonSecurityLogger"/>
</interceptor-stack>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to