C
C
click_f2017-02-21 15:48:48
Java
click_f, 2017-02-21 15:48:48

How to get field from context?

For a server application, authorization is required in some third-party services through a login, password, key, etc., in a word, ordinary String constant fields. In order to avoid having to rebuild and deploy the project when changing this data, as I understand it, you can write them as in context.xml which is located in webapp/META-INF and, if necessary, edit only this xml "hot".
1. How to get these fields from the context?
2. Is it safe to store such data in this way? If not, what is the best way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aol-nnov, 2017-02-21
@click_f

@ConfigurationProperties, for example
and then sp-el and away we go

@Value("${name}")
private String name;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question