Index: lams_common/src/java/org/lamsfoundation/lams/util/MessageService.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/util/MessageService.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/util/MessageService.java 14 Feb 2006 03:00:22 -0000 1.1 @@ -0,0 +1,51 @@ +/* + *Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * + *This program is free software; you can redistribute it and/or modify + *it under the terms of the GNU General Public License as published by + *the Free Software Foundation; either version 2 of the License, or + *(at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + *but WITHOUT ANY WARRANTY; without even the implied warranty of + *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *GNU General Public License for more details. + * + *You should have received a copy of the GNU General Public License + *along with this program; if not, write to the Free Software + *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + *USA + * + *http://www.gnu.org/licenses/gpl.txt + */ +package org.lamsfoundation.lams.util; + +import org.springframework.context.MessageSource; +import org.springframework.context.NoSuchMessageException; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.context.support.MessageSourceAccessor; + +public class MessageService { + private MessageSourceAccessor messageAccessor; + + private MessageSource messageSource; + /** + * @return + */ + public MessageSource getMessageSource() { + return messageSource; + } + public void setMessageSource(MessageSource messageSource){ + this.messageSource = messageSource; + } + public String getMessage(String key){ + String message; + try { + messageAccessor = new MessageSourceAccessor(messageSource); + message = messageAccessor.getMessage(key,LocaleContextHolder.getLocale()); + } catch (NoSuchMessageException e) { + message = "??" + key + "??"; + } + return message; + } +} Index: lams_monitoring/conf/xdoclet/filter-mappings.xml =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/conf/xdoclet/filter-mappings.xml,v diff -u -r1.3 -r1.4 --- lams_monitoring/conf/xdoclet/filter-mappings.xml 23 Jan 2006 06:02:21 -0000 1.3 +++ lams_monitoring/conf/xdoclet/filter-mappings.xml 14 Feb 2006 03:01:46 -0000 1.4 @@ -23,6 +23,10 @@ /* + LocaleFilter + /* + + HibernateFilter /* Index: lams_monitoring/conf/xdoclet/filters.xml =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/conf/xdoclet/filters.xml,v diff -u -r1.3 -r1.4 --- lams_monitoring/conf/xdoclet/filters.xml 13 Oct 2005 07:57:11 -0000 1.3 +++ lams_monitoring/conf/xdoclet/filters.xml 14 Feb 2006 03:01:46 -0000 1.4 @@ -25,6 +25,12 @@ + LocaleFilter + + org.lamsfoundation.lams.web.filter.LocaleFilter + + + HibernateFilter org.lamsfoundation.lams.util.CustomizedOpenSessionInViewFilter