[
https://issues.apache.org/jira/browse/DELTASPIKE-228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408900#comment-13408900
]
Mark Struberg commented on DELTASPIKE-228:
------------------------------------------
right now we have the following logic. Allow me to take your examples and
clarify what we do
1. String welcomeTo(); // Key: welcomeTo
2. String getWelcomeTo(); // Key: getWelcomeTo
3 String getWelcomeTo(); // Key: getWelcomeTo
We don't apply any special logic but just take the method name and use if for
the resource lookup.
or the EL name: If you use EL-2.2 you can just type
#{type.welcomeTo()}
or even add parameters:
#{type.welcomeTo(location)}
EL-2.2 is perfectly fine with those and will invoke the welcomeTo methods.
> Make @MessageBundle annotated type available via EL
> ----------------------------------------------------
>
> Key: DELTASPIKE-228
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-228
> Project: DeltaSpike
> Issue Type: New Feature
> Components: I18n-Module, JSF-Module
> Affects Versions: 0.2-incubating
> Reporter: Thomas Herzog
> Assignee: Mark Struberg
> Fix For: 0.4-incubating
>
>
> After you defined an MessageBundle type, you wanna use it in the views as
> well without wrapping the type into a @Named annotated cdi bean to be
> available to use it via EL.
> It would be fine if the implementation would be created and registrered as an
> cdi bean at deployment time and therefore available via EL in the views.
> I think the main usage for the messages is in the views, at least in our
> usacases.
> Therefore it would also nice to define the name of the created cdi bean via
> maybe @MessageContextConfig annotation and default should be the name of the
> type, but the name of the type could be same, just placed in different
> packages.
> If this will be done the developer only has to define his MessageBundle type
> with the getter for the messages and configuration via annotation if
> necessary, and use it in the views right away.
> Regarding to issue DELTASPIKE-223 it would be necessary to think about
> follwing possible issues.
> If there would be multiple choices for the convention of the getter methods
> for the messages defined in the MessageBundle type, there could occur
> follwing problems.
> 1. String welcomeTo(); // Key: welcome_to
> 2. String getWelcomeTo(); // Key: welcome_to with get prefix
> 3 String getWelcomeTo(); // Key: get_welcome_to
> @1
> How will EL resolve the method if called via #{type.welcomeTo} ?
> As far as i know EL would try to invoke getWelcomeTo() method which could not
> be found in this case !!
> @2 and 3
> How will it be distiguished if get prefix is part of the key or just the
> start of the getter method?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira