Return-Path: X-Original-To: apmail-struts-user-archive@www.apache.org Delivered-To: apmail-struts-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8BC6210FBE for ; Tue, 27 Aug 2013 13:31:06 +0000 (UTC) Received: (qmail 33065 invoked by uid 500); 27 Aug 2013 13:31:03 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 33027 invoked by uid 500); 27 Aug 2013 13:31:00 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 33007 invoked by uid 99); 27 Aug 2013 13:30:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Aug 2013 13:30:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [74.125.83.44] (HELO mail-ee0-f44.google.com) (74.125.83.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Aug 2013 13:30:53 +0000 Received: by mail-ee0-f44.google.com with SMTP id b47so2287715eek.3 for ; Tue, 27 Aug 2013 06:30:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:message-id:date:from:reply-to:organization :user-agent:mime-version:to:subject:references:in-reply-to :content-type; bh=a/KCHxXnnH3ZIimy40fWd450NGRYRi+JD+2BUuyUbDU=; b=njY5MR17cpvkAlfXEBYSkMTSjndXxnejFbZ7/Ia8Sjh+GCc4eyznEYGb/2kkhJcq34 J0PQNKfLpDXKopvz3+aHgapCf1maqjq8NXEGIDggb0hiT1vwGTkFGLXDKIInZw7Q3LBb /O0rSd8RhNyWzqY0E2T4Z4LerD8hijehFlg3FHDZOuPrFn/L8oTZPVOVcw/vEacvN2+S 0eXzHu9bS7JRovNapSQAexsq3Mno0DIzoXTFDIy6fQj56HfuPAgEKOV6JbCrgITiK2B3 p5bHtHmY/BU0XW0QjFEjrnTLXImxI5YUDx07SgZyeGUelWCA9WFeS2/1T1GWvWYHHKqV S9aw== X-Gm-Message-State: ALoCoQnabkz94qhG/HU2ft5iVyBwcrvFxoLbM5TusK0oPEX8Tv1gdTaEU33scQ/70wlYtyHdDPti X-Received: by 10.15.90.132 with SMTP id q4mr252734eez.98.1377610210714; Tue, 27 Aug 2013 06:30:10 -0700 (PDT) Received: from Thomas-Lionel-Smets-MacBook-Pro.local (caron.approach.be. [188.118.19.81]) by mx.google.com with ESMTPSA id n48sm29262366eeg.17.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Aug 2013 06:30:10 -0700 (PDT) Message-ID: <521CA9D9.3030802@a3-system.eu> Date: Tue, 27 Aug 2013 15:30:01 +0200 From: "Thomas Lionel SMETS (prof)" Reply-To: thomas.smets@a3-system.eu Organization: A3 SYSTEM sprl-bvba User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Struts Users Mailing List Subject: Re: Interceptor in various struts.xml References: <1376663297.86507.YahooMailNeo@web126201.mail.ne1.yahoo.com> <1377526712.34942.YahooMailNeo@web126205.mail.ne1.yahoo.com> <521C8868.6060907@a3-system.eu> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2GVJVJIJJWVHLSDSNIOSH" X-Virus-Checked: Checked by ClamAV on apache.org ------enig2GVJVJIJJWVHLSDSNIOSH Content-Type: multipart/mixed; boundary="------------000003090903000607070800" This is a multi-part message in MIME format. --------------000003090903000607070800 Content-Type: multipart/alternative; boundary="------------080902010604040103060706" --------------080902010604040103060706 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Typically, MdcLoggingUtility does this : @Override public String intercept(ActionInvocation invocation) throws Exception { =20 /* * This code puts a unique Id to the Mapped Diagnostic * context. Since MDC is a static class, we can directly access i= t * with out creating a new object from it. */ String uniqueId =3D UniqueIdGenerator.generateId(Constants.MAX_UNIQUE_ID_LENGTH); MDC.put(LoggingConstant.TRANSACTION_ID, uniqueId); =20 if(LOG.isInfoEnabled()) =20 LOG.info("Putting a unique ID in the context : " + uniqueId);= String invocationResponse =3D invocation.invoke(); if(LOG.isInfoEnabled()) =20 LOG.info("Removing unique ID from the context : " + MDC.get(LoggingConstant.TRANSACTION_ID)); MDC.remove(LoggingConstant.TRANSACTION_ID); return invocationResponse; =20 } but it is not set in most Actions of module_1 & module_2 \T, On 27/08/13 13:55, Dave Newton wrote: > What doesn't work? > > Dave > On Aug 27, 2013 7:08 AM, "Thomas Lionel SMETS (prof)" > wrote: > >> I created my interceptor stack in the top-level struts.xml, like this = : >> > "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" >> "http://struts.apache.org/dtds/struts-2.3.dtd" >> >> >> >> >> >> > class=3D"com.mysite.common.MdcLoggingUtility"/> >> >> >> ^[a-zA-Z0-9_]+$ >> 40 >> >> >> info >> >> >> >> >> >> >> >> ... >> >> >> >> >> >> >> I have tried different declaration in the submodules but thay all seem= s to >> not thoroughly work. >> So having the same declaration or the same declaration with different = name >> for the interceptor or using "MyStack" in the extends ... >> >> >> Any idea would be appreaciated. >> >> Tx, >> >> >> >> >> >> >> >> >> >> >> >> -- >> Thomas Lionel SMETS, CISSP (385434) >> *m :* +32 497 44 68 12 >> *ph :* +32 2 852 3341 >> *skype :* thomas.lionel.smets >> >> PGP =3D FDF0 8FB8 4F37 3F79 1011 05AB 0DCE 9BAB 5DD0 0E10 >> --=20 Thomas Lionel SMETS, CISSP (385434) *m :* +32 497 44 68 12 *ph :* +32 2 852 3341 *skype :* thomas.lionel.smets PGP =3D FDF0 8FB8 4F37 3F79 1011 05AB 0DCE 9BAB 5DD0 0E10 --------------080902010604040103060706 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Typically, MdcLoggingUtility does this= :

   @Override
    public String intercept(ActionInvocatio= n invocation) throws Exception {       
        /*
=
         * This co= de puts a unique Id to the Mapped Diagnostic
         * context= =2E Since MDC is a static class, we can directly access it
         * with ou= t creating a new object from it.
         */
        String uniqueId =3D UniqueIdGenerator.generateId(Constants.MAX_UNIQUE_ID_LENGTH);
        MDC.put(Logging= Constant.TRANSACTION_ID, uniqueId);                if(LOG.isInfoEn= abled())   
          &nb= sp; LOG.info("Putting a unique ID in the context : " + uniqueId);
        String invocati= onResponse =3D invocation.invoke();
        if(LOG.isInfoEn= abled())   
          &nb= sp; LOG.info("Removing unique ID from the context : " + MDC.get(LoggingConstant.TRANSACTION_ID));
        MDC.remove(Logg= ingConstant.TRANSACTION_ID);
        return invocati= onResponse;       
    }

but it is not set in most Actions of module_1 & module_2

\T,





On 27/08/13 13:55, Dave Newton wrote:
What doesn't work?

Dave
 On Aug 27, 2013 7:08 AM, "Thomas Lionel SMETS (prof)" <tsmets@a3-system=
=2Eeu>
wrote:

I created my interceptor stack in the top-level struts.xml, like this :
<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
  "http://struts.apache.org/dtds/struts-2.3.dtd"<http://struts.apache.org/dtds/struts-2.3.dtd>

        
<struts>

    <package name=3D"default" namespace=3D"/" extends=3D"struts-defaul=
t">

        <interceptors>
            <interceptor name=3D"logging"
class=3D"com.mysite.common.MdcLoggingUtility"/>
            <interceptor-stack name=3D"MyStack">
                <interceptor-ref name=3D"params">
                    <param name=3D"acceptParamNames">^[a-zA-Z0-9_]+=
$</param>
                    <param name=3D"paramNameMaxLength">40</param=
>
                </interceptor-ref>
                <interceptor-ref name=3D"timer" >
                    <param name=3D"logLevel">info</param>
                </interceptor-ref>
                <interceptor-ref name=3D"defaultStack" />
            </interceptor-stack>
        </interceptors>

        <default-interceptor-ref name=3D"MyStack" />

=2E..

    <include file=3D"module_1/struts.xml" />
    <include file=3D"module_2/struts.xml" />
</struts>


I have tried different declaration in the submodules but thay all seems t=
o
not thoroughly work.
So having the same declaration or the same declaration with different nam=
e
for the interceptor or using "MyStack" in the extends ...


Any idea would be appreaciated.

Tx,











--
Thomas Lionel SMETS, CISSP (385434)
*m :* +32 497 44 68 12
*ph :* +32 2 852 3341
*skype :* thomas.lionel.smets

PGP =3D FDF0 8FB8 4F37 3F79 1011 05AB 0DCE 9BAB 5DD0 0E10


    


--
Thomas Lionel SMETS, CISSP (385434)
m : +32 497 44 68 12
ph : +32 2 852 3341
skype : thomas.lionel.smets

PGP =3D FDF0 8FB8 4F37 3F79 1011 05AB 0DCE 9BAB 5DD0 0E10
--------------080902010604040103060706-- --------------000003090903000607070800 Content-Type: text/x-vcard; charset=utf-8; name="tsmets.vcf" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="tsmets.vcf" begin:vcard fn:Thomas Lionel SMETS n:SMETS;Thomas Lionel org:A3 SYSTEM sprl - bvba adr:;;rue J. Wytsman 62/2;Brussels;;1050;Belgium email;internet:Thomas.Smets@a3-system.eu title:Sole Proprior tel;work:+32 2 852 3341 tel;cell:+32 497 44 68 12 note:CISSP - 385434 x-mozilla-html:TRUE version:2.1 end:vcard --------------000003090903000607070800-- ------enig2GVJVJIJJWVHLSDSNIOSH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJSHKnhAAoJELxzIm94ZQJHIbEIAM+93AIis8GYvbw9KPPtuRbs UVp7YGs+8lwYCPpQ3Q/X8ULp/NiRAA6IjwS8exR7KRib90Dqr1nFl/Q0e1agLyWV lxI8lbmmeA9xXI/EU2HFF2qxBmAYuYoOriED0mff+0NP0slanezlH6t2s7vSdZLC FFB7G5UbAlOq3KW3Qx+dZX42P3njvbDcdwVJJSytiRtjkKGXRY6xgp7x/YxLgCCT ucMdwj1gx8shNbodXvR8+L+1O1UeQTFf/4Tt3HX22Yd1ZF/dnLnXzjZ2+KUzeeid qVDVwaU/co5DHV/aGcp1P8uONan+LRQUXcHYckW36AitVKGo4v86O0x9urnbIpA= =23UX -----END PGP SIGNATURE----- ------enig2GVJVJIJJWVHLSDSNIOSH--