-
Bug
-
Resolution: Done
-
Blocker
-
2.5.0.Final
-
None
When scaffolding a JSF application, without using a --webRoot parameter, the navigation in the pageTemplate.xhtml works as expected :
scaffold-setup ; scaffold-generate --targets org.agoncal.training.javaee6adv.model.Author ; scaffold-generate --targets org.agoncal.training.javaee6adv.model.CD ;
The template navigation looks like :
<ul> <li> <h:link outcome="/CD/search" value="CD"/> </li> <li> <h:link outcome="/author/search" value="Author"/> </li> </ul>
But if I specify the --webRoot parameter, then the navigation does not work as there is a / missing :
scaffold-setup ; scaffold-generate --webRoot admin --targets org.agoncal.training.javaee6adv.model.Author ; scaffold-generate --webRoot admin --targets org.agoncal.training.javaee6adv.model.CD ;
The template :
<ul> <li> <h:link outcome="admin/CD/search" value="CD"/> </li> <li> <h:link outcome="admin/author/search" value="Author"/> </li> </ul>
The correct navigation would be :
<ul> <li> <h:link outcome="/admin/CD/search" value="CD"/> </li> <li> <h:link outcome="/admin/author/search" value="Author"/> </li> </ul>
The only way to make it work is to add a / to the webroot, which is not very intuitive :
scaffold-setup ; scaffold-generate --webRoot /admin --targets org.agoncal.training.javaee6adv.model.Author ; scaffold-generate --webRoot /admin --targets org.agoncal.training.javaee6adv.model.CD ;
But this trick doesn't work for the search.xhtml page. The generated code is :
<h:link outcome="/genre/view"> <f:param name="id" value="#{_item.id}"/> <h:outputText id="itemName" value="#{_item.name}"/> </h:link>
The outcome is not right, and should contain a /admin
<h:link outcome="/admin/genre/view"> <f:param name="id" value="#{_item.id}"/> <h:outputText id="itemName" value="#{_item.name}"/> </h:link>