This is not a bug - it works as intended.

if you have a faces-config.xml in your WEB-INF directory, it will be
found and parsed automatically by the framework. If you specify this
very same file another time in the web.xml file - it will be parsed
twice.

so this is not a bug!

regards,

Martin

On 8/27/05, Joshua Davis <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Has anyone else noticed that /WEB-INF/faces-config.xml gets parsed twice if
> the web DD has a context parameter that specifies /WEB-INF/faces-config.xml?
> 
> 
> Here is what I observed:
> if there is a PhaseListener declared in /WEB-INF/faces-config.xml like this
>     <lifecycle>
>         <phase-listener>example.MyPhaseListener</phase-listener>
>     </lifecycle>
> 
> And there is a context parameter declared in /WEB-INF/web.xml like this
>     <context-param>
>         <param-name>javax.faces.CONFIG_FILES</param-name>
>         <param-value>
>             /WEB-INF/faces-config.xml
>         </param-value>
>     </context-param>
> 
> Then two instances of the MyPhaseListener get created and added to the
> FacesContext.  Once I removed the context-param from /WEB-INF/web.xml, it
> worked as I expected: exactly one instance of MyPhaseListener was created.
> I took a look at the JIRA database, and didn't find anything about this,
> should I file a bug report?
> 
> BTW, I discovered this while trying out an idea I had about using
> PhaseListener and an application scope bean to make a JSF managed-bean that
> manages Hibernate sessions.   I've seen the Spring session-in-view stuff,
> and I wanted to see if it could be done more simply, as I don't want to add
> Spring to the test application I'm working with just yet.   Is PhaseListener
> is the right 'JSF-ish' way to do such a thing?
> 
> Thanks In Advance - Josh
> [EMAIL PROTECTED]
> 
> 
> 


-- 

http://www.irian.at
Your JSF powerhouse - 
JSF Trainings in English and German

Reply via email to