Initializing contextdata automatically in struts/jsp

From: Vincent Stoessel (vincen..aymaca.com)
Date: Wed Feb 05 2003 - 17:47:53 EST

  • Next message: Andrus Adamchik: "Re: Initializing contextdata automatically in struts/jsp"

    >
    >
    > You preserved these lines in your web.xml, right?
    > <listener>
    > <listener-class>webtest.CustomConfiguration</listener-class>
    > </listener>
    >
    > If so, DataContext is created by CustomConfiguration's superclass when the
    > session is staryed. But the key to retrieve it is defined under
    > ServletConfiguration.DATA_CONTEXT_KEY as "cayenne.datacontext". Try using
    > this key instead. Or use CustomConfiguration.getDefaultContext().
    >
    > Let me know if this works. In the meantime I will see if tutorial code
    > needs to be fixed.
    >
    > Andrus
    >
    >

    Now that things are working I can go back to using

    this :
    web.xml:

      <listener>
            <listener-class>webtest.CustomConfiguration</listener-class>
      </listener>

    and this in my action classes:

    DataContext ctxt = (DataContext)
    request.getSession().getAttribute("cayenne.datacontext");

    so I won't have to initialize the session in index.html.

    Right?

    -- 
    Vincent Stoessel
    Linux Systems Developer
    vincent xaymaca.com
    



    This archive was generated by hypermail 2.0.0 : Wed Feb 05 2003 - 17:49:29 EST