This content has been marked as final.
Show 7 replies
-
1. Re: Problem with Seam Email - in Loop + Transaction
pmuir Mar 13, 2007 8:22 AM (in response to bsmithjj)http://docs.jboss.com/seam/1.2.0.PATCH1/reference/en/html/mail.html#d0e8799
But I'll put a workaround into the renderer as this keeps on coming up. -
2. Re: Problem with Seam Email - in Loop + Transaction
bsmithjj Mar 13, 2007 8:41 AM (in response to bsmithjj)Hi Pete,
Putting a loop inside the facelets isn't going to be the best approach for me - especially if you plan on putting in the Renderer workaround. Do you know of some way to flush or clear whats in the Renderer's output programmatically?
Thanks,
Brad Smith -
3. Re: Problem with Seam Email - in Loop + Transaction
bsmithjj Mar 13, 2007 8:52 AM (in response to bsmithjj)do you think something like this?
try { StringWriter stringWriter = new StringWriter(); wrapResponseWriter(facesContext, stringWriter); renderFacelet(facesContext, faceletForURL(resourceURL(viewId))); final StringBuffer sb = stringWriter.getBuffer(); final String output = sb.toString(); sb.delete(0,sb.length()-1); return output; //return stringWriter.getBuffer().toString(); }
in FaceletsRenderer.render(String viewId) would do the job? -
4. Re: Problem with Seam Email - in Loop + Transaction
pmuir Mar 13, 2007 8:59 AM (in response to bsmithjj)"bsmithjj" wrote:
Putting a loop inside the facelets isn't going to be the best approach for me
This is definitely the recommended approach - faster and easier.do you think something like this?
No, each call to Renderer.render needs a clean UIViewRoot afaics -
5. Re: Problem with Seam Email - in Loop + Transaction
pmuir Mar 13, 2007 9:05 AM (in response to bsmithjj)Can you put an issue in JIRA (Seam/Mail) to remind me to sort this out.
-
6. Re: Problem with Seam Email - in Loop + Transaction
bsmithjj Mar 13, 2007 9:10 AM (in response to bsmithjj)This is definitely the recommended approach - faster and easier.
I don't agree that looping inside the mail component is easier - I'm not sure why it would be faster ? In my EJB method, in the context of my loop, I am performing an LDAP lookup, some persistence operations, and finally, at the end of each iteration, I invoke the renderer. In order for me to follow your advice, I would need to basically build some kind of object whose sole purpose is to collect the results of all the iteration and then be made available (via, say, event context) for the purposes of rendering. I believe a more natural usage would be along the lines I am currently trying to use it.
Anyway, I appreciate your work on the mail component.
Thanks -
7. Re: Problem with Seam Email - in Loop + Transaction
pmuir Mar 13, 2007 10:07 AM (in response to bsmithjj)I'm not sure why it would be faster
Each call to the renderer causes the component tree to be built, wheras ui:repeat will reuse the exisiting tree - its the old rendertime/compiletime arguement.
So, yes, in some cases it may be easier to loop in the action method - definitely something it should support.