Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package com.javaee.injectprops;
import com.javaee.injectprops.annotations.StringProperty;
import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.inject.Inject;
import java.util.logging.Logger;
public class MainClass {
@StringProperty(value = "base_url")
private String baseUrl;
@StringProperty(value = "username")
private String username;
@StringProperty(value = "password")
private String password;
private static final Logger LOGGER = Logger.getLogger(MainClass.class.getName());
public void logPropertyValues() {"The value of the baseUrl is : " + baseUrl);"The value of the username is : " + username);"The value of the password is : " + password);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment