Note that there are some explanatory texts on larger screens.

plurals
  1. POsearch by first name in JSF1.2 + seam
    text
    copied!<p>I am trying to make search option by first name in my user list page. Before putting search option in user list page, the list of users page works fine. After I added code in list.xhtml for search the page shows the error below, Exception during request processing: Caused by javax.servlet.ServletException with message: "/secure/admin/user/customer/customerList.xhtml @70,70 value="#{userByFirstNameAction.firstName}": Property 'firstName' not found on type org.javassist.tmp.java.lang.Object_$$_javassist_seam_25"</p> <p>My list page is : customerList.xhtml</p> <pre><code> &lt;h:form class="input-list" id="searchUser" style="width:100%;" name="searchUser"&gt; &lt;div class="search_button"&gt; SEARCH BY FIRST NAME : &lt;h:inputText tabindex="1" id="firstName" type="text" value="#{userByFirstNameAction.firstName}" required="true"&gt; &lt;f:validateLength minimum="3" maximum="20" /&gt; &lt;/h:inputText&gt; &lt;/div&gt; &lt;h:commandButton value="Search" tabindex="2" action="#{userByFirstNameAction.retrieveCustomersByFirstName}"&gt; &lt;/h:commandButton&gt; &lt;/h:form&gt; </code></pre> <p>userByFirstNameAction.java :</p> <pre><code> @Name("userByFirstNameAction") @Stateless @AutoCreate public class UserByFirstNameActionImpl implements UserByFirstNameAction { private UserTypeEnum userType; @In private UserService userService; //@In(value = "firstName", scope = ScopeType.CONVERSATION, required = false) private String firstName; /** * */ private static final long serialVersionUID = 8282995226262125676L; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } @Override public List&lt;User&gt; retrieveCustomersByFirstName(String firstName) { //this.userType = UserTypeEnum.CUSTOMER; return userService.findByFirst(firstName); } } </code></pre> <p>@Jan thanks for your time..</p> <p>I have put Get/Set for firstname in bean class...</p> <p>Here for your reference</p> <p>Interface:</p> <pre><code> package com.ermms.clrp.user; import java.io.Serializable; import java.util.List; import javax.ejb.Local; import com.ermms.clrp.dto.user.CLRPUser; import com.ermms.clrp.dto.user.User; @Local public interface UserByFirstNameAction extends Serializable { public String initEmployee(); public String initCustomer(); public List&lt;User&gt; getEmployeesByFirstName(); public List&lt;User&gt; getCustomersByFirstName(); public List&lt;User&gt; retrieveEmployeesByFirstName(); // public List&lt;User&gt; retrieveCustomersByFirstName(); public List&lt;User&gt; retrieveCustomersByFirstName(String firstName); } </code></pre> <p>Class :</p> <pre><code> package com.ermms.clrp.user; import java.util.List; import javax.ejb.Stateless; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.AutoCreate; import org.jboss.seam.annotations.In; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Out; import com.ermms.clrp.common.enumeration.UserTypeEnum; import com.ermms.clrp.dto.user.CLRPUser; import com.ermms.clrp.dto.user.User; import com.ermms.clrp.service.UserService; @Name("userByFirstNameAction") @Stateless @AutoCreate public class UserByFirstNameActionImpl implements UserByFirstNameAction { private UserTypeEnum userType; @In private UserService userService; //@In(value = "firstName", scope = ScopeType.CONVERSATION, required = false) private String firstName; /** * */ private static final long serialVersionUID = 8282995226262125676L; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } @Override public List&lt;User&gt; getEmployeesByFirstName() { this.userType = UserTypeEnum.EMPLOYEE; return userService.findByFirstName(firstName, userType); } @Override public List&lt;User&gt; getCustomersByFirstName() { this.userType = UserTypeEnum.CUSTOMER; return userService.findByFirstName(firstName, userType); } @Override public List&lt;User&gt; retrieveEmployeesByFirstName() { this.userType = UserTypeEnum.EMPLOYEE; return userService.findByFirstName(firstName, userType); } @Override public List&lt;User&gt; retrieveCustomersByFirstName(String firstName) { //this.userType = UserTypeEnum.CUSTOMER; return userService.findByFirst(firstName); } public String initEmployee() { return "/secure/admin/user/customer/customerListByFirstName.xhtml"; } public String initCustomer() { this.userType = UserTypeEnum.CUSTOMER; return "/secure/admin/user/customer/customerListByFirstName.xhtml"; } public UserTypeEnum getUserType() { return userType; } public void setUserType(UserTypeEnum userType) { this.userType = userType; } } </code></pre> <p>Thanks in advance</p>
 

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