Changeset 446 for tapas/web/src


Ignore:
Timestamp:
04/02/12 17:01:12 (12 years ago)
Author:
vmipsl
Message:

getMessage récup du texte ds messages.properties

Location:
tapas/web/src/com/ether
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tapas/web/src/com/ether/Controller.java

    r445 r446  
    3333     * @throws WebException 
    3434     */ 
    35     //@ControllerMethod(view = VIEW_FORM_TAPAS, loginMandatory = true, defaultView = VIEW_INDEX) 
    36     @ControllerMethod(view = VIEW_FORM_TAPAS, loginMandatory = false, defaultView = VIEW_INDEX) 
     35    @ControllerMethod(view = VIEW_FORM_TAPAS, loginMandatory = true, defaultView = VIEW_INDEX) 
    3736    public JSONObject viewForm() 
    3837            throws WebException 
  • tapas/web/src/com/ether/ControllerEther.java

    r445 r446  
    7474    } 
    7575 
    76     /** 
    77      * This method return the text from the files messages**.properties 
    78      * 
    79      * @param code 
    80      * @return 
    81      */ 
    82     public String getMessage( @NotNull final String code ) 
    83     { 
    84         final String webInfPath = getServletContext().getRealPath( "WEB-INF" ); 
    85         return WebHelper.getMessage( webInfPath, code ); 
    86     } 
    87  
    8876    @Override 
    8977    @Nullable 
     
    9785 
    9886            request.setCharacterEncoding( UTF8Charset.getEncoding() ); 
    99 //            String message = getMessage( "bo.fulltitle" ); 
    10087 
    10188            // Get method to call 
  • tapas/web/src/com/ether/WebHelper.java

    r445 r446  
    88import org.jetbrains.annotations.NotNull; 
    99import org.jetbrains.annotations.Nullable; 
    10 import org.springframework.context.MessageSource; 
    11 import org.springframework.context.support.ClassPathXmlApplicationContext; 
    1210 
    1311import javax.servlet.ServletOutputStream; 
     
    132130    } 
    133131 
    134     /** 
    135      * This method return the text from the files messages**.properties 
    136      * 
    137      * @param code 
    138      * @return 
    139      */ 
    140     public static String getMessage( @NotNull final String webInfPath, @NotNull final String code ) 
    141     { 
    142         final MessageSource resources = new ClassPathXmlApplicationContext( webInfPath + "/classes/servlet-context.xml" ); 
    143         final String message = resources.getMessage( code, null, "Default", null ); 
    144         return message; 
    145     } 
    146  
    147132    public static final int STATUS_CODE_SERVICE_EXCEPTION = 500; 
    148133    public static final String PROPERTIES_FILE = "tapas.properties"; 
Note: See TracChangeset for help on using the changeset viewer.