What is the concept of properties in Java and / or Spring? I have a bunch of domain models, each of which has many properties Example:
public class person {private string name; Private DeadDayfallbirth; Private float height; Personal float weight;
When displaying a person, property names are hardcoded in JSP.
Name: $ {person.name} & lt; Br> Date of birth: $ {person.dateOfBirth} & lt; Br> Height: $ {person.height} & lt; Br> Weight: $ {person.weight} & lt; Br> In addition to this, there may be many different pages that display to a person, note that the date of birth is a java.util.Date
, hence JSP or Administrator will use java.text.SimpleDateFormat
to format it. The height and weight are the numbers, and they can be used for their own java.util.Format
formatting. Am I looking for a property to see property? Each property (name, date of birth, height, etc.) will have display name, format, and description (used for help or tooltips). Attributes of properties will be defined somewhere in a configuration file. When displaying an asset, the display name and format will be viewed through the property system, it will also solve localization.
My question is that something like that has already been implemented for Java.
If I understand you correctly, then you can get some of these files into an external file Format and details. You want to take a look at the spring (link), which wraps to some extent and corresponds to the square in JDK.
Using
Where your messages.properties
file contains:
user.dob = your date of birth {0}
I'm not sure how to specify the format within messages.properties
, but I know that this is possible.
Comments
Post a Comment