Archive for January, 2011

JSF2: Rendering facets inside nested composite components

January 27th, 2011 1 comment

…is not supported, as I just found out:

	<composite:facet name="basketContent"/>

	<mycomponents:box title="Shopping basket">
		<composite:renderFacet name="basketContent"/>

Read more…

JSF2: Nesting forms into each other — not a good idea

January 23rd, 2011 No comments

This problem just cost me an hour worth of debugging: Clicking on a PrimeFaces <p:commandButton/> that was inside a composite component wouldn’t trigger the server-side action that was specified in the tag. Even more strange was that I had several of these buttons (created in a loop using <ui:repeat/>), and in the generated HTML, the first one wasn’t nested into an HTML form element, while the others were. Read more…

Spring @Transactional: Verifying transaction support / Local method calls

January 23rd, 2011 2 comments

A few days ago, I was debugging a persistence issue in a recently started project that uses Spring ORM + JPA 2.0/Hibernate for persistence. Using Spring’s declarative transaction support, enabling transaction management for your services is just a matter of annotating the service methods with @Transactional, assuming you have properly set up a transaction manager and tell Spring to process your @Transactional bean annotations:

<tx:annotation-driven proxy-target-class="true"/>

Since I couldn’t explain why my code wasn’t working, I began wondering if the transaction support for my service method was configured correctly. Read more…