Index: lams_common/src/java/org/lamsfoundation/lams/util/MessageService.java =================================================================== diff -u --- lams_common/src/java/org/lamsfoundation/lams/util/MessageService.java (revision 0) +++ lams_common/src/java/org/lamsfoundation/lams/util/MessageService.java (revision 1f7e3b82231660a37539aa7f689cd8620f9a91c5) @@ -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 =================================================================== diff -u -rc1dfdde7a9d5ed9b49fc9772bbb9f018b085d00b -r1f7e3b82231660a37539aa7f689cd8620f9a91c5 --- lams_monitoring/conf/xdoclet/filter-mappings.xml (.../filter-mappings.xml) (revision c1dfdde7a9d5ed9b49fc9772bbb9f018b085d00b) +++ lams_monitoring/conf/xdoclet/filter-mappings.xml (.../filter-mappings.xml) (revision 1f7e3b82231660a37539aa7f689cd8620f9a91c5) @@ -23,6 +23,10 @@ /* + LocaleFilter + /* + + HibernateFilter /* Index: lams_monitoring/conf/xdoclet/filters.xml =================================================================== diff -u -r4ffb4f1a2bfc99e753289a089a51c92129409397 -r1f7e3b82231660a37539aa7f689cd8620f9a91c5 --- lams_monitoring/conf/xdoclet/filters.xml (.../filters.xml) (revision 4ffb4f1a2bfc99e753289a089a51c92129409397) +++ lams_monitoring/conf/xdoclet/filters.xml (.../filters.xml) (revision 1f7e3b82231660a37539aa7f689cd8620f9a91c5) @@ -25,6 +25,12 @@ + LocaleFilter + + org.lamsfoundation.lams.web.filter.LocaleFilter + + + HibernateFilter org.lamsfoundation.lams.util.CustomizedOpenSessionInViewFilter