You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Davor Hrg (JIRA)" <de...@tapestry.apache.org> on 2008/01/10 15:06:34 UTC

[jira] Reopened: (TAPESTRY-1965) @Symbol annotation returns sericeId when used without @Inject

     [ https://issues.apache.org/jira/browse/TAPESTRY-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davor Hrg reopened TAPESTRY-1965:
---------------------------------


I'm reopening this so docs can be more specific on this and an example added.
not much effort, but to help confused folks like me :)

When looking for symbols, there is only one mention of @inject I could find (in javadoc vor @Value).

If you look at
http://tapestry.formos.com/nightly/tapestry5/tapestry-ioc/provider.html

the @Value is used without @Inject

on the symbols docs page
http://tapestry.apache.org/tapestry5/tapestry-ioc/symbols.html

@Symbol is not even mentioned, just the expansions ${sth}


Javadoc for @Symbol says:
Used to inject a symbol value, via a symbol name. This is used much like {@link Value}


and finaly whn I look at @Value javadoc:
Used in conjunction with {@link Inject} to inject a literal value, rather than a service


.. hoep you can see my confusion with this ...
the docs could be fixed to make this more clear.

P.S.
after writing this... i looked back at th example on page
http://tapestry.formos.com/nightly/tapestry5/tapestry-ioc/provider.html

and changed my test to:
@Value("${"+InternalConstants.TAPESTRY_APP_NAME_SYMBOL+"}") String appName,

which is then done right by the docs, and problem is the same as with
@Symbol (both without @Inject)



> @Symbol annotation returns sericeId when used without @Inject
> -------------------------------------------------------------
>
>                 Key: TAPESTRY-1965
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1965
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 5.0.7
>            Reporter: Davor Hrg
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>
> I have a simple decorator that uses tapestry app-name...
> I tested this problem in three module methods:
> contributeApplicationDefaults
> buildTimingFilter
> decorateComponentMessagesSource
> using:
> @Symbol(InternalConstants.TAPESTRY_APP_NAME_SYMBOL)
> if @Symbol is used with @Inject
> the results are ok:
> contributeApplicationDefaults.APPNAME app
> buildTimingFilter.APPNAME app
> decorateComponentMessagesSource.APPNAME app
> if used without @Inject contrib method has ok result
> contributeApplicationDefaults.APPNAME app
> buildTimingFilter.APPNAME TimingFilter
> decorateComponentMessagesSource.APPNAME ComponentMessagesSource
> If @Symbol is not intended to be used without @inject
> Exception should be thrown to avoid problems from unexpected results

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org