-
1. Re: AtCreate and exception handling
pmuir Jul 16, 2008 11:16 PM (in response to mail.micke)What JSF phase does the @Create get called in?
-
2. Re: AtCreate and exception handling
mail.micke Jul 16, 2008 11:53 PM (in response to mail.micke)I think it is in the render response phase, I'll double check again tomorrow at work.
-
3. Re: AtCreate and exception handling
pmuir Jul 16, 2008 11:58 PM (in response to mail.micke)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.
-
4. Re: AtCreate and exception handling
mail.micke Jul 17, 2008 11:04 AM (in response to mail.micke)Ok,
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?
Thanks,
Micke -
-
6. Re: AtCreate and exception handling
pmuir Jul 17, 2008 12:34 PM (in response to mail.micke)@Create can be used with Seam exception handling, but not if it is called in the render response phase.
-
7. Re: AtCreate and exception handling
mail.micke Jul 17, 2008 12:45 PM (in response to mail.micke)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.
Thanks,
micke -
8. Re: AtCreate and exception handling
pmuir Jul 17, 2008 2:27 PM (in response to mail.micke)No, I'm saying you can't handle the exception in the render response phase. Thats all.
-
9. Re: AtCreate and exception handling
mail.micke Jul 17, 2008 2:44 PM (in response to mail.micke)Ok, are you saying
no
to 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.
-
10. Re: AtCreate and exception handling
pmuir Jul 17, 2008 2:47 PM (in response to mail.micke)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).
-
11. Re: AtCreate and exception handling
mail.micke Jul 17, 2008 3:40 PM (in response to mail.micke)Ok.
Many thanks for the help.
Btw. enjoyed your talk at the previous BJUG.
- micke