[JBoss Seam] - Simple Action Redirect with Parameters
by RRLevering
Possibly I'm using the paradigm wrong, but since this is a fairly straightforward question, I want to check early. I have a simple navigation problem within a CRUDish application. I want to navigate from one page to another, carrying along the conversation context. I'm using parameter passing to handle the object identification, so an excerpt from pages.xml looks something like:
| ...
| <page view-id="/division.xhtml">
| <param name="divisionId" value="#{manageDivision.divisionId}" />
| <navigation from-action="viewDepartment">
| <redirect view-id="/department.xhtml" />
| </navigation>
| </page>
| <page view-id="/department.xhtml">
| <param name="departmentId" value="#{manageDepartment.departmentId}" />
| </page>
| ...
|
So I have a s:link on one page somehow pointing to another page that deals with a different type of object. I embed the parameter in the s:link (using an f:param) so that the target page can identify the object I'm interested in. Now here's my issue. I'd ideally like to abstract away the view-id from the link. So I want the s:link to have a 'action="viewDepartment"' attribute and the pages.xml redirects in case I want to change my file naming scheme later. If I use 'view="/department.xhtml"' everything works grand. However, if I use the abstract action String, it treats the link as an internal application link and fetches the department id from the unitialized manageDepartment bean and not from the passed parameter. Is there anyway to have this abstract link mapping without losing my simple parameter passing ability?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047703#4047703
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047703
18 years, 11 months
[JBoss Seam] - Re: release connection after lazy init in view
by imario
Ok, looks like I found another solution/workaround.
I provide my own Hibernate ConnectionProvider (by decorating the original one). This provider hands out so called "DisconnectableConnections" and keeps track of all borrowed/released connections.
In a ServletFilter (at the end of the response) all not release connections will be "disconnected".
Notice, Hibernate still holds the DisconnectableConnection and thinks everything is fine.
One the next access via such a connection (which is "discconnected") it will be automatically reconnected.
"disconnected" in this context simply means it has been passed back to the connection pool.
Instead of using a ConnectionProvider one might simply decorate the connection pool itself ... but this is another story, though, it should work with any orm mapper then.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047696#4047696
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047696
18 years, 11 months