在JSF1.2 + seam中按名字搜索

时间:2013-08-12 06:05:01

标签: hibernate jsf jpa jboss seam

我正在尝试通过我的用户列表页面中的名字来创建搜索选项。在将搜索选项放入用户列表页面之前,用户列表页面工作正常。 在list.xhtml中添加代码进行搜索后,页面显示以下错误,         请求处理期间的异常:         由javax.servlet.ServletException引起的消息:“/ secure / admin / user / customer / customerList.xhtml @ 70,70 value =”#{userByFirstNameAction.firstName}“:在类型org.javassist上找不到属性'firstName'。 tmp.java.lang.Object _ _ $$ javassist_seam_25"

我的列表页面是:customerList.xhtml

    <h:form class="input-list" id="searchUser" style="width:100%;"
        name="searchUser">
        <div class="search_button">
            SEARCH BY FIRST NAME :
            <h:inputText tabindex="1" id="firstName" type="text"
                value="#{userByFirstNameAction.firstName}" required="true">
                <f:validateLength minimum="3" maximum="20" />
            </h:inputText>
        </div>

        <h:commandButton value="Search" tabindex="2"
            action="#{userByFirstNameAction.retrieveCustomersByFirstName}">
        </h:commandButton>
    </h:form>

userByFirstNameAction.java:

    @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<User> retrieveCustomersByFirstName(String firstName) {
            //this.userType = UserTypeEnum.CUSTOMER;
            return userService.findByFirst(firstName);      
        }

    }

@Jan谢谢你的时间..

我在bean类中输入了get / Set作为firstname ...

供您参考

接口:

    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<User> getEmployeesByFirstName();

        public List<User> getCustomersByFirstName();

        public List<User> retrieveEmployeesByFirstName();

        // public List<User> retrieveCustomersByFirstName();

        public List<User> retrieveCustomersByFirstName(String firstName);
    }

班级:

    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<User> getEmployeesByFirstName() {
            this.userType = UserTypeEnum.EMPLOYEE;
            return userService.findByFirstName(firstName, userType);
        }

        @Override
        public List<User> getCustomersByFirstName() {
            this.userType = UserTypeEnum.CUSTOMER;
            return userService.findByFirstName(firstName, userType);        
        }

        @Override
        public List<User> retrieveEmployeesByFirstName() {
            this.userType = UserTypeEnum.EMPLOYEE;
            return userService.findByFirstName(firstName, userType);
        }

        @Override
        public List<User> 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;
        }

    }

提前致谢

0 个答案:

没有答案