I don't know how other people's taste in XML goes, but the following reads
really well to me:
<page view-id="/getDocument.jsp">
| <on action="#{documentHome.get}">
| <redirect to-view-id="/editDocument.jsp"
when="#{documentHome.document!=null}">
| <param name="documentId" value="#{documentHome.document.id}"/>
| </redirect>
|
| <redirect to-view-id="/404.jsp"
when="#{documentHome.document==null}" />
| </on>
|
|
| <on action="#{logout.logout}">
| <redirect to-view-id="/login.jsp" />
| </on>
| </page>
Or, with explicit outcome declaration:
<page view-id="/getDocument.jsp">
| <on action="#{documentHome.get}">
| <outcome value="#{documentHome.document!=null}" />
|
| <redirect to-view-id="/editDocument.jsp" when-outcome="true">
| <param name="documentId" value="#{documentHome.document.id}"/>
| </redirect>
|
| <redirect to-view-id="/404.jsp" when-outcome="false" />
| </on>
|
| <on action="#{logout.logout}">
| <redirect view-id="/login.jsp" when-null-outcome="true" />
| </on>
| </on>
Although, I think it might be even better if outcome were just a variable:
| <redirect to-view-id="/editDocument.jsp" when="#{outcome==true}">
| ...
| <redirect to-view-id="/404.jsp" when="#{outcome==null}">
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994525#3994525
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994525
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user