On Dec 17, 2007 9:12 AM, Dale Newfield <[EMAIL PROTECTED]> wrote:
> Attempting to upgrade to 2.1 to finish my optiontransferselect testing
> (in 2.0.11 the "select all before submit" is implemented by dojo, which
> I'm not using, so I'm still not quite done--when I am I'll post any
> appropriate .ftl changes to JIRA.)
>
> Is there a better list to ask about xwork changes?

Not really.  I try to create a jira ticket for each change, but that's about it.

> So I replaced a few places (a service class, a listener, and a taglib)
> that used DefaultTextProvider.INSTANCE.getText() with an
> injection/lookup of a bean implemented by DefaultTextProvider:
>
> <bean id="textProvider"
> class="com.opensymphony.xwork2.DefaultTextProvider"/>

I think that might only provide the default text provider.  I plan to
spend some time this week cleaning that section up.

> But now the first time I try to use that bean I get a
> NullPointerException at
> com.opensymphony.xwork2.DefaultTextProvider.getText(DefaultTextProvider.java:64)
>
> Which I think means that ActionContext.getContext() is returning null,
> even though the javadoc says: "Returns the ActionContext for the current
> thread, is never null."
>
> I'm accessing this from a listener (LoginListener) that is trying to
> generate i18ized messages of the form "Last successful login at X, N
> unsuccessful login attempts since then."  Is the ActionContext null
> because I've not yet been dispatched to an action?  What is the
> appropriate way now to do getText() lookups from a listener?

Ah, yeah, I should change those javadocs.  Now, ActionContext can be
null, unless it is during an action execution (basically everything
behind the ActionProxy).  Therefore, the listener approach won't work,
unless you put it between the s2 filter and the s2 cleanup filter,
similar to how sitemesh is configured.

Don

>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to