Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Weld Users Forum ListTopic List
08. May 2009, 20:43 America/New_York | Link

Obviously, bean names must be globally unique in an application. Otherwise, the result of looking up a bean by name (such as in the EL) would be ambiguous. Thus, it's best practice to provide fully qualified names for beans. The Web Beans RI follows this practice when naming the Conversation bean:

public
@Named("javax.context.conversation")
@RequestScoped
@Standard
class ConversationImpl implements Conversation, Serializable
{
   ...
}

However, it would be pretty annoying to always have to type #{javax.context.conversation} in your view templates. Therefore, applications will want to alias this name to a shorter name that the developer can guarantee will not clash with other names in the application. The question becomes, how is this done? Is it as easy as defining a name for Conversation in beans.xml? In that case, would it be the interface or the implementation? And does the name provided in XML override the name in the annotation?

Btw, we need to use this pattern a lot in Seam 3, so it's important to nail it down now.

 

Dan Allen | mojavelinux.com | Author of Seam in Action

2 Replies:
12. May 2009, 09:39 America/New_York | Link

It's something that needs to be solved at the view level. Pages should be able to import a namespace. But that's not currently supported in JSF. We can probably implement it in Seam.

 

Learn more about Weld...

15. May 2009, 18:47 America/New_York | Link

Got it. I'll add that to the list. We can find a place for it in the new metadata facet in JSF 2, for all intents and purposes, is a substitute for the <page> node in pages.xml (minus the navigation parts).

 

Dan Allen | mojavelinux.com | Author of Seam in Action