0

In config.properties file, there will be users key will multiple users as property values. There may be n users.

users = user1, user2, user3

How to split the users by commas using java and retrieve single value in each line and store it as either list or array without using spring framework/module.

  • Try to use annotation @Value and Spring Expression Language to retrieve your properties according to your needs ex: @Value("#{'${users}'.split(',')}") private List userList; – nurmanbetov Nov 02 '21 at 07:14
  • I do not want to use Spring module – unanonymous56 Nov 02 '21 at 07:17
  • Then try to use Autowired annotation or through constructor injection to retrieve from Environment, such that: @Autowired private Environment environment; – nurmanbetov Nov 02 '21 at 07:22

0 Answers0