How make struts2 see my properties file

后端 未结 3 357
鱼传尺愫
鱼传尺愫 2021-01-13 01:17

Hi I have this project structure

\"enter

and in my index.jsp I ha

相关标签:
3条回答
  • 2021-01-13 01:52

    Your properties file needs to be in the your classes directory under WEB-INF or a sub-directory of classes directory.

    Let's assume that you have this structure .../Web-INF/classes/property/content.properties, you will need to do this in your struts.xml

    <constant name="struts.custom.i18n.resources" value="property.content" />

    0 讨论(0)
  • 2021-01-13 01:58

    First rename your content.properties to global_en.properties. Later put it in src folder

    0 讨论(0)
  • 2021-01-13 02:03

    You have done all things OK but you have not kept the property file name as of the Action name . The name should be Login.property.

    Also please make sure that the property file must be in the same package as of the Action against it is being created.

    Please refer the following link for details:

    http://struts.apache.org/release/2.2.x/docs/message-resource-files.html

    Thanks, Shahid Saeed Khan

    0 讨论(0)
提交回复
热议问题