users@glassfish.java.net

Re: Help with RequestDispatcher.include() in jsf component

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Tue, 17 Apr 2007 09:47:54 -0700

glassfish_at_javadesktop.org wrote:
> The jsf 1.2 spec states:
>
> "Several mechanisms (including the <jsp:include> standard action, the JSTL <c:import> custom action when referencing a resource in the same webapp, and a call to RequestDispatcher.include() for a resource in the same webapp) perform a runtime dynamic inclusion of the results of including the response content of the requested page resource in place of the include action. Any JSF components created by execution of JSF component custom actions in the included resource will be grafted onto the component tree, just as if the source text of the included page had appeared in the calling page at the position of the include action."
>
> As far as I can tell, what I am attempting to do *should* work. Either it is a bug, or I am doing something wrong with my implementation. Either way some feedback would be great!
>
This is a problem of timing. The component tree has already been built
by the time encodeEnd() is called on your component. Because of this,
no components in the page included by your component will be rendered.

The typical order of operation in JSF 1.2 is:

   - dispatch request to target view to build the component tree
   - dispatch returns, we have a tree, call encodeAll() (which will call
      the various encode methods on the components) on the view.

You'll have to stick to using page build time includes (jsp:include) or
some other custom action that is not a JSF component to include
other components.


> Thanks
> Cameron
> [Message sent by forum member 'cameronr' (cameronr)]
>
> http://forums.java.net/jive/thread.jspa?messageID=212641
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>