English 中文(简体)
利用春天框架在大鼠中添加双倍
原标题:Adding folder to classpath in Velocity using Spring framework

How can I add an entire folder to Velocity and use the files inside as resource bundles?

目前的速度是我。 我有这一法典:

<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
    <property name="parentMessageSource">
      <ref bean="globMessageSource"/>
    </property>
    <property name="basenames">
      <list> 
        <value>classpath:/WEB-INF/i18n</value>
        <value>/WEB-INF/templates/velocity/my_vm_template</value>
   </list> 
</bean>

我需要在班次中增加一18英寸,以便其档案能够由VelocityTools版本1.4在工具箱中看到:xml:

 <tool>
   <key>test</key>
   <scope>request</scope>
   <class>org.apache.velocity.tools.generic.ResourceTool</class>
   <parameter name="bundles" value="i18n.ss_messages"/>
   <parameter name="locale" value="en_US"/>
 </tool>

守则给我一个错误的信息:“java.util.MissingResourceException: Can t为基准名i18n.s_messages, locale en_US”找到dle

This question relates to VelocityTools error - "java.util.MissingResourceException: Can t find bundle for base name WEB-INF.conf.resources.ss_messages, locale en_US"

如果是令人sil笑皆是的问题,但我可以找到任何地方,说明如何在班次中增加一整倍的双倍,并且可以用作一篮子,以便它能够支持Velocity模板的本地化。

www.un.org/Depts/DGACM/index_spanish.htm IMPORTANT NOTE! 如果我把我的话题——bg_BG.properties and ss_messages_en_US.properties file in /WEB-INF/classes/i18n,那么它就能够发挥作用,但我想将其放在一个不同的方面,最好是在WEB-INF/templates/i18n。 我如何这样做?

问题回答

你们是否使用ma子? 你们可以把该名录用作资源:

        <resource>
            <!-- Velocity requires to be in classpath -->
            <directory>src/main/webapp/WEB-INF/i8n</directory>
            <filtering>true</filtering>
        </resource>




相关问题
How does gettext handle dynamic content?

In php (or maybe gettext in general), what does gettext do when it sees a variable to dynamic content? I have 2 cases in mind. 1) Let s say I have <?=$user1?> poked John <?=$user2?>. ...

Explain the Need for Mutexes in Locales, Please

Reading the question Why doesn’t C++ STL support atoi(const string& ) like functions?, I encountered a comment which warned that GCC (at least) has a bug that can slow down multi-threaded ...

How does Vistalizer work

How does Vistalizer manage to override the language limit in Windows Vista Home edition. Which api s does it use to allow installation of Multiple language packages.

Localized exceptions (within a Struts2 app)

I am developing a Struts 2 application with support for multiple languages. If one of the domain objects needs to throw an exception, how can it do so in such a way that the error message is no ...

Rails Globalize plugin help

Has anyone gotten the Globalize plugin to work Rails 2.3.2 or later? If so, could you direct me to some useful info?

热门标签