I checked all the ways its not the Case sensitive problem.But I have same naming convention in both bean and jsf page but still I am getting an error property not found.
I am using primefaces-5.2
and I have that jar in WEB-INF/lib
.
Below is the code:
Bean Class
public class User implements Serializable{
public String getSomeMethod(){
System.out.println("Hi from SomeMethod");
return "";
}
}
my index.XHTMl page.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets" >
<h:head>
<!-- Mimic Internet Explorer 8 -->
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>User Details</title>
<script type="text/javascript">
window.location.hash="no-back-button";
window.location.hash="Again-No-back-button";
//again because google chrome don't insert first hash into history
window.onhashchange=function(){
window.location.hash="no-back-button";
}
</script>
</h:head>
<h:body>
<h:outputStylesheet library="css" name="application.css" />
<img height="80" width="100%" src="#{facesContext.externalContext.requestContextPath}/images/LSHeader.jpg" alt="logo" />
<form name="myform" action="#{user.getSomeMethod}" method="post"></form>
</h:body>
</html>
Faces-config
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<managed-bean>
<managed-bean-name>user</managed-bean-name>
<managed-bean-class>com.tn.gov.User</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
Error what i am receiving.
javax.el.ELException: /index.xhtml: Property 'getSomeMethod' not found on type com.tn.gov.User