You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Matthias Wessendorf <ma...@matthias-wessendorf.de> on 2004/07/08 09:53:35 UTC

discussing RequestWrapperI (was FW: [Myfaces-develop] Fwd: MyFaces - Struts


-----Original Message-----
From: myfaces-develop-admin@lists.sourceforge.net
[mailto:myfaces-develop-admin@lists.sourceforge.net] On Behalf Of
Matthias Wessendorf
Sent: Wednesday, June 23, 2004 9:59 AM
To: myfaces-develop@lists.sourceforge.net
Subject: RE: [Myfaces-develop] Fwd: MyFaces - Struts


Oliver

i used the examples, that were shipped via struts-faces.

there is a *link* to URL
http://localhost:8080/struts-faces/editRegistration.do?action=Create

okay, struts does it's way (the FacesRequestProcessor of
integration-lib)

Action.clazz gets processed. it returns an ActionForward-Objekt. (called
"success"), but in struts-config the Actionforward points to a path
"/registration.faces". ok fine.

in FacesRequestProcessor, that is used instead of *default*
RequestProcessor, the method "doForward()" checks, if URI
(/registration.faces) is an Struts-Request. it is not that case.

so it creates a FacesContext 
<code>
        // Create a FacesContext for this request if necessary
        LifecycleFactory lf = (LifecycleFactory)
            FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
        Lifecycle lifecycle = // FIXME - alternative lifecycle ids
            lf.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
        FacesContext context = FacesContext.getCurrentInstance();
        if (context == null) {
            if (log.isTraceEnabled()) {
                log.trace("  Creating new FacesContext for '" + uri +
"'");
            }
            FacesContextFactory fcf = (FacesContextFactory)
 
FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
            context = fcf.getFacesContext(servlet.getServletContext(),
request,
                                          response, lifecycle); 
        }
</code>

after that it creates a new ViewRoot, delegates the context to our
JSPViewHandler, finally it calls responseComplete() <code>
        // Create a new view root
        ViewHandler vh = context.getApplication().getViewHandler();
        if (log.isTraceEnabled()) {
            log.trace("  Creating new view for '" + uri + "'");
        }
        context.setViewRoot(vh.createView(context, uri));

        // Cause the view to be rendered
        if (log.isTraceEnabled()) {
            log.trace("  Rendering view for '" + uri + "'");
        }
        lifecycle.render(context);
        context.responseComplete();
</code>


so the Servlet-Path is still the *.do - thing,

that code works *directly* with RI, 

> This will be the correct one in
> your case 
> but might be wrong in some other case.


jupp :-) that was the reason of my question.
do you need any more information on that?

Cheers,



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Myfaces-develop mailing list
Myfaces-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/myfaces-develop


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org