A
alexjaquet
Hi,
I'm new to JSF/Spring/Hibernate and I got an error with a simple jsf
test :
javax.servlet.ServletException: Cannot get value for expression
'#{customerService.dummyString}'
In my jsp page I've put the following code :
<f:view>
<h:form>
<h:inputText value="#{customerService.dummyString}" rendered="true"
required="false" />
</h:form>
</f:view>
in my java class I've the following code :
public class CustomerGUI {
private CustomerService customerService;
private String dummyString;
public String getdummyString() {
return "dummyString";
}
public void setdummyString(String dummyString) {
this.dummyString = "dummyString";
}
public List<Customer> getAllCustomers () {
if (customerService != null) {
return customerService.getAllCustomers();
}else {
return null;
}
}
and my faces-config is the following :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD
JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config >
<application>
<variable-resolver>
org.springframework.web.jsf.DelegatingVariableResolver
</variable-resolver>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>fr</supported-locale>
<supported-locale>de</supported-locale>
</locale-config>
</application>
<navigation-rule>
<from-view-id>/customerList.jsp</from-view-id>
</navigation-rule>
<navigation-rule>
<from-view-id>/customerDetails.jsp</from-view-id>
</navigation-rule>
<navigation-rule>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>doIndex</from-outcome>
<to-view-id>/index.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>doCustomerList</from-outcome>
<to-view-id>/customerList.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>customerGui</managed-bean-name>
<managed-bean-class>
com.test.gui.CustomerGUI
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>customerService</property-name>
<property-class>
com.test.business.CustomerServiceImp
</property-class>
<value>#customerService</value>
</managed-property>
</managed-bean>
</faces-config>
any idea ? thx for responding
I'm new to JSF/Spring/Hibernate and I got an error with a simple jsf
test :
javax.servlet.ServletException: Cannot get value for expression
'#{customerService.dummyString}'
In my jsp page I've put the following code :
<f:view>
<h:form>
<h:inputText value="#{customerService.dummyString}" rendered="true"
required="false" />
</h:form>
</f:view>
in my java class I've the following code :
public class CustomerGUI {
private CustomerService customerService;
private String dummyString;
public String getdummyString() {
return "dummyString";
}
public void setdummyString(String dummyString) {
this.dummyString = "dummyString";
}
public List<Customer> getAllCustomers () {
if (customerService != null) {
return customerService.getAllCustomers();
}else {
return null;
}
}
and my faces-config is the following :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD
JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config >
<application>
<variable-resolver>
org.springframework.web.jsf.DelegatingVariableResolver
</variable-resolver>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>fr</supported-locale>
<supported-locale>de</supported-locale>
</locale-config>
</application>
<navigation-rule>
<from-view-id>/customerList.jsp</from-view-id>
</navigation-rule>
<navigation-rule>
<from-view-id>/customerDetails.jsp</from-view-id>
</navigation-rule>
<navigation-rule>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>doIndex</from-outcome>
<to-view-id>/index.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>doCustomerList</from-outcome>
<to-view-id>/customerList.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>customerGui</managed-bean-name>
<managed-bean-class>
com.test.gui.CustomerGUI
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>customerService</property-name>
<property-class>
com.test.business.CustomerServiceImp
</property-class>
<value>#customerService</value>
</managed-property>
</managed-bean>
</faces-config>
any idea ? thx for responding