I'm trying to figure out a good way to start migrating from struts to JSF
(w/o Shale at this point).

I've been thinking that it would be very handy if I could do something like
this:

        <action
                path="/something">
            <forward name="success" path="#{someBean.someAction}"/>
        </action>

Then the expression that is forwarded to would be passed to the JSF
application and rendered from there.  Obviously this would be much easier in
Struts 1.3 as the forward could be handled by a seperate command, but for
now I'm okay with extending the RequestProcessor.  For those not using
Shale, something like this could make initialization of a JSF page much
easier, as this would provide a kind of implicit "prerender" functionality.

Has anyone done something like this and could point me to some sample code?
Basically, take a non-faces request, get a reference to the context and
lifecycle, and then start JSF processing at the "Invoke Application" phase.
I have my own ideas on the code it would take to do this below, but would
welcome more detailed examples if available.

Assuming I have my lifecycle, context, and application variables defined,
should something like this work?
MethodBinding mb = application.createMethodBinding(forward.getPath(), null);
String view = mb.invoke(context, null);  //Assume this is a global outcome
context.getNavigationHandler().handleNavigation(context, null, view);
lifecycle.render(context);

Reply via email to