Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy this call from JSF to Hibernate controller returns javax.el.MethodNotFoundException?
    primarykey
    data
    text
    <p>I'm trying to execute a query to a mySQL database through Hibernate, for that I've developed a simple JSF page to introduce two words and search by these fields, but when I try to execute the method which make the query, I go an exception: <strong>javax.el.MethodNotFoundException</strong></p> <p>Here is the JSF page:</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"&gt; &lt;h:head&gt; &lt;title&gt;Plans search&lt;/title&gt; &lt;/h:head&gt; &lt;h:body&gt; &lt;h3&gt;Plan Search&lt;/h3&gt; &lt;h:form&gt; &lt;h:selectOneRadio id="searchBy" value="#{myController.searchBy}"&gt; &lt;f:selectItem itemLabel="By User" itemValue="User Name"&gt;&lt;/f:selectItem&gt; &lt;f:selectItem itemLabel="By Plan" itemValue="Plan Name"&gt;&lt;/f:selectItem&gt; &lt;/h:selectOneRadio&gt; &lt;h:inputText label="Name" id="name" value="#{myController.name}"&gt;&lt;/h:inputText&gt; &lt;h:inputText label="Surname" id="surname" value="#{myController.surname}"&gt;&lt;/h:inputText&gt; &lt;h:commandButton id="search" type="submit" value="Search" action="#{myController.userPlans}"&gt;&lt;/h:commandButton&gt; &lt;/h:form&gt; &lt;div&gt;&lt;h:outputText value="#{myController.name} was invited to the following plans"&gt;&lt;/h:outputText&gt;&lt;/div&gt; &lt;h:dataTable id="plansid" value="#{myController.userPlans}" var="plans" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px"&gt; &lt;h:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Plans Name"&gt;&lt;/h:outputText&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{plans.planName}"&gt;&lt;/h:outputText&gt; &lt;/h:column&gt; &lt;/h:dataTable&gt; &lt;/h:body&gt; </code></pre> <p></p> <p>and the code for myController is:</p> <pre><code>import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import javax.faces.model.DataModel; import javax.faces.model.ListDataModel; @ManagedBean @SessionScoped public class MyController { MyHelper helper; DataModel listUSer; private DataModel userPlans; private String name; private String surname; Users user; private String searchBy; /** * Creates a new instance of myController */ public MyController() { helper = new MyHelper(); } public MyController(String name, String surname) { helper = new FeverHelper(); this.name = name; this.surname = surname; } void recreateModel() { setUserPlans(null); } /** * @return the searchBy */ public String getSearchBy() { return searchBy; } /** * @param searchBy the searchBy to set */ public void setSearchBy(String searchBy) { this.searchBy = searchBy; } /** * @return the name */ public String getName() { return name; } /** * @param name the name to set */ public void setName(String name) { this.name = name; } /** * @return the surname */ public String getSurname() { return surname; } /** * @param surname the surname to set */ public void setSurname(String surname) { this.surname = surname; } /** * @return the userPlans */ public DataModel getUserPlans() { if (userPlans == null) { setUserPlans(new ListDataModel(helper.getUserPlans(getName(), getSurname()))); } return userPlans; } /** * @param userPlans the userPlans to set */ public void setUserPlans(DataModel userPlans) { this.userPlans = userPlans; } </code></pre> <p>}</p> <p>Appareantly is well defined, isn't it?</p> <p>I'm just working over the index.xhtml file, without templates, or other padding stuff.</p> <p>Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload