What JSF phase does the @Create get called in?
I think it is in the render response phase, I'll double check again tomorrow at work.
Seam can't handle exceptions in the render response phase (this is documented, though not perhaps very clearly). Add a JIRA, we can tidy this up.
thanks for clearing that out for me!
It is a shame though, @Create is where I usually initialize date to be displayed on the screen...
Just tried @Observer(
org.jboss.seam.postCreate.name) and same problem.
Is there a way for me of initializing data at component creation which allows me to take advantage of Seams error handling?
@Create can be used with Seam exception handling, but not if it is called in the render response phase.
What you are saying is that if it is called in a post-back request it will work but not in the initial (forgot the name) request? If the bean is event scoped.
If so, I'm curious in which phase it executes, just before the invoke application?
It would be nice if there was some documentation about this in the section covering the @Create annotation (saw you re-phrased the jira).
Have to admit that I'm not 100% sure when it executes for me, all I see is that the restore view phase finishes and then there is the exception and after that render response is complete.
No, I'm saying you can't handle the exception in the render response phase. Thats all.
Ok, are you saying
noto all the questions I asked?
Above you said that @Create can be used with seam exception handling, but not if it is called in the render-response phase.
So that must mean that sometimes it doesn't execute in that phase, right?
Also curious why Seam can't handle exceptions in the render response phase? I'm able to manually redirect to an error page.
Ignore the word no, it's just my bad use of English ;-)
Sure, @Create is called when the bean is instantiated, this can be in any phase.
Once the response has started being written you can no longer call a servlet redirect (as servlet doesn't buffer the response, but passes it straight off to the browser).
Many thanks for the help.
Btw. enjoyed your talk at the previous BJUG.