Should this issue be in the JSF queue? I looked at the VSL and it appears that the Controller class is generated from there.
What is the connection to tell JSF to generate a delegate pattern instead of a service locater pattern?
You need to change the serviceAccessorPattern namespace property (in the jsf namespace) appropriately for your framework:
i.e. <property name="serviceAccessorPattern">${application.package}.ServiceLocator.instance().get{1}()</property>
Chad
Thanks for the quick response.
My adromda.xml file actually has the property set as you indicate. I looked into the how tos and found a different setting for ejb and set that. Same result, however I think I can get the accessor to work by tweaking the property.
In addition to that issue, the generated controller code has a method that returns a ProectService reference instead of a reference to the bean (see method header).
/**
* Returns a reference to the projectService back-end service.
*/
protected final pts.service.ProjectService getProjectService()
{
try
{
return pts.ProjectServiceUtil.getHome().create();
}
catch (final Throwable throwable)
{
throw new RuntimeException(throwable);
}
}
Is there another property that controls this generaton?
A workaround I can suggest is to remove the modelled dependencies from your controller to the session beans. The getters won't be generated and will leave you to implement the delegate calls in the controller implementation class.
Ultimately, I think the ejb3 cartridge should be used with a seam cartridge that extends the jsf cartridge, thereby (I think) eliminating service locators and delegates all together.