[opencms-dev] Analyzed but not solved yet: Broken behaviour of contentload/show/info tag

Bernd Wolfsegger bw at code-create.com
Mon Oct 17 18:10:51 CEST 2005


.... but it should be set to null via the setLocale method whilst 
initializing...

Huh, but setLocale() is never called ..., but it should be, or am I wrong?

On Monday, 17. October 2005 18:46, Bernd Wolfsegger wrote:
> Well, simple.
> In the "release()" method m_locale is set to null, but the release method
> is not called from request to request...
>
> From the J2EE Javadoc:
>
> javax.servlet.jsp.tagext.Tag Interface:
>
> Lifecycle
>
> Lifecycle details are described by the transition diagram below, with the
> following comments:
>
>     * [1] This transition is intended to be for releasing long-term data.
> no guarantees are assumed on whether any properties have been retained or
> not. * [2] This transition happens if and only if the tag ends normally
> without raising an exception
>     * [3] Note that since there are no guarantees on the state of the
> properties, a tag handler that had some optional properties set can only be
> reused if those properties are set to a new (known) value. This means that
> tag handlers can only be reused within the same "AttSet" (set of attributes
> that have been set).
>     * Check the TryCatchFinally interface for additional details related to
> exception handling and resource management.
>
> .....
>
> release
>
> public void release()
>
>     Called on a Tag handler to release state. The page compiler guarantees
> that JSP page implementation objects will invoke this method on all tag
> handlers, but there may be multiple invocations on doStartTag and doEndTag
> in between.
>
> .....
>
> Kind regards, Bernd Wolfsegger
>
> On Monday, 17. October 2005 18:19, Bernd Wolfsegger wrote:
> > O.k. A view into the source code.
> > The locale is retrieved from the CmsRequestContext ... so it should be
> > o.k. But this is done only if m_locale is null. But it is not null. At
> > least not after the second request of the ressource (added some debug
> > information to the code). So it seems, that somehow m_locale is not reset
> > from one request to the other. The value retrieved form the
> > CmsRequestContext is o.k..
> >
> > Indeed in the 6.0.0 code there was no "if (m_locale == null)...".
> > So why is the value for m_locale kept?
> >
> >
> > Kind regards, Bernd Wolfsegger
> >
> > On Monday, 17. October 2005 17:03, Bernd Wolfsegger wrote:
> > > OpenCms 6.0.2 release notes:
> > >
> > > ....
> > > "Added options to access XML content based on a given locale to
> > > <cms:contentload/show/info> tags"
> > > ....
> > >
> > > Well, would have been very nice if this would not break with previous
> > > behaviour ...
> > > But it does. When not using the new "locale" option, the first default
> > > locale is used and not the locale retrieved by the default locale
> > > handler class as it was before ...
> > > Well, this means scrubbing JSPs ... but ... how can i insert a locale
> > > value in the contentshow tag dynamically when it is not allowed to use
> > > script inside ...?
> > > hm, there was something ... i remember ... anybody who knows?
> > > may be I am faster finding out myself.
> > >
> > > or better, is it possible to have the previous behaviour back somehow;
> > > would be a logical behaviour also.
> > >
> > > Kind regards, Bernd



More information about the opencms-dev mailing list