Load the MessageBundle from expression language
-----------------------------------------------

                 Key: SOLDER-115
                 URL: https://issues.jboss.org/browse/SOLDER-115
             Project: Seam Solder
          Issue Type: Feature Request
          Components: Core
    Affects Versions: 3.0.0.Final
         Environment: MessageBundle in Seam api 3.0.1-SNAPSHOT
            Reporter: luca stancapiano
             Fix For: 3.0.1.Beta1


Could be useful some automatism for expression language when you use an 
interface as:

@MessageBundle
public interface Mymessages {
        
        @Message("ettete")
        String unastringa();
}


The one manner I've found to call it inside a view through expression language 
is on theese three steps:

1 - rename the method unastringa transforming it in a getter method: 
getUnastringa

2 - create a backing bean or use a bean marked with the @Named annotation:


     @Named
     public class Search {
        
        @Inject @MessageBundle
        Mymessages mymessages;
    
        public Mymessages getMymessages() {
            return mymessages;
        }
     }

3 - call it inside a view with the expression:

      #{search.mymessages.unastringa}



I tried too to call it directly as Resource Bundle creating the files 
Mymessages.i18n_*.properties and generating automatically the implementation 
classes but the double dot in the name of the files generates a classloading 
problem.


Could be nice load the messages through an expression language like: 
#{mymessages.unastringa} without pass in theese steps maybe working during the 
creation of the implementation classes so:

1 - add automatically getter methods

2 - add automatically the annotation @Named("interface_name_with_language")

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
seam-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-issues

Reply via email to