i got this issue a class containing protected attributes :
Test Class:
abstract public class Test extends WithAttachment{
static ISQLTest pISQLTest = null;
// Ajour une refence au campagne ??? pour resoudre le Warning
/**
* Date de creation du test
*/
protected Date creationDate;
/**
* Nom complet du concepteur du test
*/
protected String conceptorName;
/**
* Login du concepteur du test
*/
protected String conceptorLogin;
.....}
Managed bean :
private Test selectedTest; // with getters and setters
xhtml page :
<h:panelGrid columns="2" cellpadding="4" header="Test Details">
<h:outputText value="Name of The Test :" />
<h:outputText value="#{projectTestManagementMB.selectedTest.name}" />
<h:outputText value="Creation Date :" />
<h:outputText value="#{projectTestManagementMB.selectedTest.creationDate}" />
<h:outputText value="Executed :" />
<h:outputText value="#{projectTestManagementMB.testExecutedFlag}" />
<h:outputText value="Owner :" />
<h:outputText value="#{projectTestManagementMB.selectedTest.conceptorName} #{projectTestManagementMB.selectedTestconceptorLogin}" />
</h:panelGrid>
so when i try to access them in my xhtml page in EL expression i get this error ;
t
attribute name can no be resolved as member of selectedTest
So is there a possibility to solve this problem without changing the access type (protected) of class Test attributes .
Any help will be appreciated
Well, just as it says – there’s no “name” attribute in
Test, unless that’s inWithAttachmentwhich you haven’t shown us.You’ve got
conceptorName, but notname. Admittedly I don’t know whether having a protected field will be good enough anyway – I’d expect a private field and a publicgetName()property.