thanks for the suggestions.
- i don't think i need any jsf facilities during processing,
so your first suggestion would be most pragmatic.
- just in case i end up needing to go the second route though, for this
or something else, how does one "call the standard navigation handler
manually"?
- just for kicks i tinkered with a javascript hack to call an action
method, and this seems to work although it has the drawbacks of:
(a) having to specify the button id as named by the jsf implementation
(i.e. <form name>:<button name>) and i don't think this naming
convention is part of the spec and therefore not portable and
(b) having the dummy form flash momentarily although you might be able
to give the button zero size or something so that it is a completely
blank screen
<%@ include file="/include/taglibs.jsp"%>
<body onload="document.getElementById('dummy:submit').click();">
<f:view>
<h:form id="dummy">
<h:commandButton id="submit" action="#{account.complete}" />
</h:form>
</f:view>
</body>
- as an aside, i originally tried document.dummy.submit() for onload,
but it resulted in an infinite loop. i'm sure an artifact of the clever
way jsf is implemented, but unexpected just the same.
Craig McClanahan wrote:
Since you don't care about restoring a JSF component tree on this
particular page, it might be simpler to not worry about using JSF at
all to process the request:
* Create a standalone servlet mapped to the front of the URL
on the confirmation email.
* It would use standard servlet API facilities to pull the information
it needs out of the URL, and do the database lookup/update.
* It would navigate by doing a RequestDispatcher.forward() to
either "/congratulations.faces" or "/problem.faces".
If you did want to use JSF facilities in the processing (say, you
wanted to evaluate value bindings or create managed beans), an
alternative would be to use a phase listener for the "Before Restore
View" event, intercepting the incoming request before the standard
processing lifecycle. Your handler could do the database update, then
call the standard navigation handler manually based on the outcome.