You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to use Interface Class and I did not declare properties in that Interface, I can't recover it from JSF Managed Bean to use it in xhtml Page.
AppConfig.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.nando.meetings.utils;
import org.aeonbits.owner.Config;
import org.aeonbits.owner.Config.HotReload;
import org.aeonbits.owner.Config.Sources;
/**
*
* @author fernando
*/
@HotReload
@Sources({"file:/Users/fernando/Desktop/borrar/meetings/conf/meetings.properties"})
public interface AppConfig extends Config {
}
AppConfigBean.java (JSF Managed Bean)
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.nando.meetings.bean;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import java.io.Serializable;
import org.aeonbits.owner.ConfigFactory;
import org.nando.meetings.utils.AppConfig;
/**
*
* @author fernando
*/
@Named(value = "appConfigBean")
@SessionScoped
public class AppConfigBean implements Serializable {
/**
* Creates a new instance of AppConfigBean
*/
AppConfig appConfig;
String AppName;
public AppConfigBean() {
appConfig = ConfigFactory.create(AppConfig.class);
}
public String getAppName() {
return appConfig.AppName();
}
}
Part of xhtml page
<b:row style="margin-bottom: 70px;">
<b:navBar brand="#{appConfigBean.appName}" brandHref="#{request.contextPath}/faces/index.xhtml"
style="" inverse="true" position="top" sticky="true">
<!-- Following line is needed for TBS 3.0.1 (panel content overflow issue) -->
<b:navbarLinks pull="right"><b:navLink value=" " href="#"></b:navLink></b:navbarLinks>
<b:navbarLinks pull="right">
<b:navbarLinks>
<b:navLink value="#{app.MenuRegistration}"
href="#{request.contextPath}/faces/Registration.xhtml"></b:navLink>
</b:navbarLinks>
</b:navbarLinks>
</b:navBar>
</b:row>
This returns and error saying: Create public method.
Then create it as:
@HotReload
@Sources({"file:/Users/fernando/Desktop/borrar/meetings/conf/meetings.properties"})
public interface AppConfig extends Config {
public String AppName();
}
Please add an add-on or procedure to create Interface Class definitions because my Config File Includes App Messages and has aprox 300 properties, that is so hard to define one by one in OWNER Interface Class.
The text was updated successfully, but these errors were encountered:
When I try to use Interface Class and I did not declare properties in that Interface, I can't recover it from JSF Managed Bean to use it in xhtml Page.
AppConfig.java
AppConfigBean.java (JSF Managed Bean)
Part of xhtml page
This returns and error saying: Create public method.
Then create it as:
Please add an add-on or procedure to create Interface Class definitions because my Config File Includes App Messages and has aprox 300 properties, that is so hard to define one by one in OWNER Interface Class.
The text was updated successfully, but these errors were encountered: