mp.jaxrs.application-configuration.adoc Maven / Gradle / Ivy
///////////////////////////////////////////////////////////////////////////////
Copyright (c) 2018, 2024 Oracle and/or its affiliates.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
///////////////////////////////////////////////////////////////////////////////
= Configuring the Application
:description: Helidon MicroProfile application configuration
:keywords: helidon, microprofile, micro-profile
:rootdir: {docdir}/../..
include::{rootdir}/includes/mp.adoc[]
Your application can use the MicroProfile Config or
Helidon Config (or both). MicroProfile Config offers portability to other
MicroProfile servers. Helidon Config supports a full tree structure, including repeating
elements.
== Configuring the Application
You can inject values that the application can access from both MicroProfile Config and from
Helidon Config.
[source,java]
.Jakarta REST - inject a single config property
----
include::{sourcedir}/mp/jaxrs/ApplicationConfigurationSnippets.java[tag=snippet_1, indent=0]
----
You can also inject the whole configuration instance,
either `io.helidon.config.Config` or
`org.eclipse.microprofile.config.Config`.
[source,java]
.Jakarta REST - inject config
----
include::{sourcedir}/mp/jaxrs/ApplicationConfigurationSnippets.java[tag=snippet_2, indent=0]
----
© 2015 - 2025 Weber Informatics LLC | Privacy Policy