Hi,
result with latest weld:
1) #{conversation} resolves to null
2) #{javax.enterprise.context.conversation} resolves to Conversation
instance.
it means that A)
http://docs.jboss.org/weld/reference/1.0.1-CR2/en-US/html/scopescontexts.html#d0e1882
is not up-to-date documentation
B) specification is correct and
C) WELD implements it
Isn't solution for this simple
if ("javax.enterprise.context.conversation".equals(property))
in ELResolver?
Martin
Mark Struberg píše v Út 23. 02. 2010 v 12:03 +0000:
> I don't think that dots may be allowed in EL names in generally, since dots
> are used to separate single objects from each other.
>
> E.g. a
>
> #{"manager.user.name"}
>
> would look up a bean named "manager" then look for a member called "user" in
> this manager instance and finally call getName() on the user we got from the
> manager.
>
> Thus something like a @Named("org.apache.dingsda.name"), although valid from
> the JSR-299 spec perspective, it is not accessible from EL.
>
>
> Maybe there should be a statement somewhere in the spec that names given to
> beans must match the EL spec if they are to be used in EL statements?
>
> LieGrue,
> strub
>
> PS: @Named is still a valid @Qualifier in the JSR-330 sense, so one could
> easily use the sample above to do something like
>
> private @Inject @Named("org.apache.dingsda.name") MyCls myInstance;
>
> This is perfectly valid, but we do not suggest to use @Named this way.
>
>
> --- Gurkan Erdogdu <[email protected]> schrieb am Di, 23.2.2010:
>
> > Von: Gurkan Erdogdu <[email protected]>
> > Betreff: Re: Ideas about conversation
> > An: [email protected]
> > Datum: Dienstag, 23. Februar, 2010 12:52 Uhr
> > >>>1) RI documentation says
> > that conversation bean can be acccessed from EL
> > JSR-299 says that Conversation instance must be accessed
> > with EL
> > name(Actually this is the name of Conversation Bean) *
> > "javax.enterprise.context.conversation*" not with
> > *"conversation"*. This
> > name is valid according to the section 2.5 Bean EL Names.
> > Currently EL
> > implementation does not support "dot" notation names. If we
> > try to use it to
> > get conversation, it throws exception that says "javax" not
> > found. I do not
> > know how to handles this requirement. It needs contribution
> > :)
> >
> > >>>Others
> > These are extensions that are not related with OWB. I think
> > that Mark has
> > started a some extension project for MyFaces.
> >
> > --Gurkan
> >
> >
> > 2010/2/23 Martin Koci <[email protected]>
> >
> > > Hi,
> > >
> > > 1) RI documentation says that conversation bean can be
> > acccessed from EL
> > > with name "
> > > conversation":
> > > http://docs.jboss.org/weld/reference/1.0.1-CR2/en-US/html/scopescontexts.html#d0e1882(but
> > is it mentioned in spec?)
> > >
> > > This is probably not implemented in OWB. Simple hack
> > in WebBeansELresolver
> > > solves it:
> > >
> > > if ("conversation".equals(property)) {
> > >
> > context.setPropertyResolved(true);
> > >
> > return
> > >
> > manager.getInstanceByType(javax.enterprise.context.Conversation.class);
> > > }
> > >
> > > but this is only first try.
> > >
> > > 2) accessing conversation scope as java.util.Map from
> > EL
> > >
> > > JSF currently has implicit objects sessionScope,
> > requestScope, viewScope
> > > ... It would be nice if OWB can expose current
> > conversation context as map
> > > too - see example below.
> > >
> > >
> > > 3) JSF 2.0 support custom scopes:
> > > http://blogs.sun.com/rlubke/entry/custom_managed_bean_scopes.
> > > Maybe exposing conversation context as custom scope
> > can be useful for
> > > existing applications.
> > >
> > >
> > > 4) uses cases for conversation: I checked all our
> > applications and the most
> > > common use case is (unsurprisingly):
> > > - start conversation
> > > - put some objects into conversation scope
> > > - start dialog/conversation with user
> > > - user ends dialog
> > > - end conversation
> > >
> > > following example comes from trinidad:
> > >
> > > <h:commandButton action="dialog:textEdit"
> > > returnListener="#{bean.processReturn}">
> > >
> > <f:setPropertyActionListener value="a value passed to
> > dialog"
> > > target="#{pageFlowScope.valueKey}" />
> > >
> > <f:setPropertyActionListener value="other value passed to
> > dialog"
> > > target="#{pageFlowScope.otherValueKey}" />
> > > </h:commandButton>
> > >
> > >
> > > with CDI (and 1 and 2 implemented) it looks:
> > >
> > > <h:commandButton action="dialog:textEdit"
> > > returnListener="#{conversation.end()}">
> > > <f:actionListener
> > binding="conversation.start()" />
> > >
> > <f:setPropertyActionListener value="a value passed to
> > dialog"
> > > target="#{conversationScope.valueKey}" />
> > >
> > <f:setPropertyActionListener value="other value passed to
> > dialog"
> > > target="#{conversationScope.otherValueKey}" />
> > > </h:commandButton>
> > >
> > > What do you think? I'm not sure what belongs to CDI
> > implementation and what
> > > should be a separate extension.
> > >
> > >
> > > Regards,
> > >
> > > Martin Kočí
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Gurkan Erdogdu
> > http://gurkanerdogdu.blogspot.com
> >
>
> __________________________________________________
> Do You Yahoo!?
> Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
> gegen Massenmails.
> http://mail.yahoo.com
>