0

I found some way to solve the similar question,but none of them make sense to me

Project directory:

my project directory

And my properties file content is

name=hello

this is my test code:

<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<fmt:bundle basename="messages1"></fmt:bundle>
<h1><fmt:message key="name"></fmt:message></h1> 


this is my result ???name???
Some people said Some solutions about how to solve the similar question is put the properties file under the projectname/Java Resources/src/ but as you can see my project directory I put the proerties file in the 'right' place, but it makes no sense. Why? Thanks in advance.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Eward.Sun
  • 11
  • 2

1 Answers1

0

Sorry,guys,I have found the problem, It's my mistake.I should write

<h1><fmt:message key="name"></fmt:message></h1> 

in the body of <fmt:bundle basename="com/messages1"></fmt:bundle> instead of out of the body. Anyway, thank you for taking time to see my question!:)

Eward.Sun
  • 11
  • 2