You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dennis Byrne <de...@dbyrne.net> on 2006/01/13 20:43:07 UTC

NPE with custom.scope.ScopeUtils

I am getting a NPE in ScopeUtils.getManagedBean when making a non-faces request -> faces response .   The problem goes away if I place the following at the top of getManagedBean ...

        if(FacesContext.getCurrentInstance() == null)
           return null;

Also, in ScopeUtils.isEl, should it be 
   beanName.startsWith("EL_BEGIN") 
or
   beanName.startsWith(EL_BEGIN)  ?



Re: NPE with custom.scope.ScopeUtils

Posted by Bruno Aranda <br...@gmail.com>.
I guess you are true. I think that the ScopeUtils.isEl should be

beanName.startsWith(EL_BEGIN) && beanName.endsWith(EL_END);

(note the removal of quotes from EL_BEGIN and the removal of the '!'
before beanName.endsWith)

I've changed that in the SVN, hoping to be enough awake to commit
things. Thanks Dennis,

Bruno

2006/1/13, Dennis Byrne <de...@dbyrne.net>:
> I am getting a NPE in ScopeUtils.getManagedBean when making a non-faces request -> faces response .   The problem goes away if I place the following at the top of getManagedBean ...
>
>         if(FacesContext.getCurrentInstance() == null)
>            return null;
>
> Also, in ScopeUtils.isEl, should it be
>    beanName.startsWith("EL_BEGIN")
> or
>    beanName.startsWith(EL_BEGIN)  ?
>
>
>