Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 在Seam中按特定cloumn名称搜索_Jsf_Seam_Crud - Fatal编程技术网

Jsf 在Seam中按特定cloumn名称搜索

Jsf 在Seam中按特定cloumn名称搜索,jsf,seam,crud,Jsf,Seam,Crud,我正在使用jsf1.2在seam中工作 对我来说一切正常,除了搜索操作。谁能建议我走正确的路吗 以下是我的表格: <h:form class="input-list" id="searchUser" style="width:100%;" name="searchUser"> <div class="edit-label">FIRST NAME :</div>

我正在使用jsf1.2在seam中工作

对我来说一切正常,除了搜索操作。谁能建议我走正确的路吗

以下是我的表格:

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

            <h:commandButton value="Search" tabindex="2" style="margin-left: 5px"
                action="#{userListAction.retrieveName}" class="usersearch">
            </h:commandButton>
        </h:form>

名字:
我的界面:

    @Local
    public interface UserListAction extends Serializable {

        public List<User> retrieveCustomers();

        public List<User> retrieveEmployees();

        public List<User> getUsersList();

        public CLRPUser getLoginUser();

        public List<User> retrieveName();

        @WebRemote
        public String deleteById(Integer userId);

        @WebRemote
        public CLRPUser getUserById(Integer userId);

        public UserTypeEnum getUserType();

        public void setUserType(UserTypeEnum userType);

        public void setFirstName(String firstName);

        public String getFirstName();

        public CLRPUser getCurrentUser();

        public void setCurrentUser(CLRPUser currentUser);

    }
    @Name("userListAction")
    @Stateless
    @AutoCreate
    public class UserListActionImpl implements UserListAction {

        @In
        protected UserService userService;

        @Out(value = "userType", scope = ScopeType.CONVERSATION, required = false)
        private UserTypeEnum userType;

        @In
        private LoggedInUser loggedInUser;

        @Out(value = "currentUser", scope = ScopeType.CONVERSATION, required = false)
        @In(value = "currentUser", scope = ScopeType.CONVERSATION, required = false)
        private CLRPUser currentUser;   

        @In(value = "firstName", scope = ScopeType.CONVERSATION, required = false)
        private String firstName;

        /**
         * 
         */

        private static final long serialVersionUID = 8649412602585430272L;

        /*
         * (non-Javadoc)
         * 
         * @see com.ermms.clrp.user.UserAction#getUsersList()
         */


        public List<User> retrieveName() {
            System.out.print("FirstName is :" + firstName);
            return userService.getAllUsers(firstName);
        }


        public UserTypeEnum getUserType() {
            return this.userType;
        }

        public void setUserType(UserTypeEnum userType) {
            this.userType = userType;
        }

        public void setFirstName(String firstName) {
            this.firstName = firstName;
        }

        public String getFirstName() {
            return firstName;
        }

        @Override
        public CLRPUser getCurrentUser() {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public void setCurrentUser(CLRPUser currentUser) {
            // TODO Auto-generated method stub

        }
    }
@Local
公共接口UserListAction扩展了可序列化{
公共列表检索客户();
公共列表检索员工();
公共列表getUsersList();
公共CLRPUser getLoginUser();
公共列表检索名称();
@网络远程
公共字符串deleteById(整数用户ID);
@网络远程
公共CLRPUser getUserById(整数用户ID);
public UserTypeEnum getUserType();
public void setUserType(UserTypeEnum userType);
public void setFirstName(字符串firstName);
公共字符串getFirstName();
公共CLRPUser getCurrentUser();
公共无效setCurrentUser(CLRPUser currentUser);
}
实现接口的操作类:

    @Local
    public interface UserListAction extends Serializable {

        public List<User> retrieveCustomers();

        public List<User> retrieveEmployees();

        public List<User> getUsersList();

        public CLRPUser getLoginUser();

        public List<User> retrieveName();

        @WebRemote
        public String deleteById(Integer userId);

        @WebRemote
        public CLRPUser getUserById(Integer userId);

        public UserTypeEnum getUserType();

        public void setUserType(UserTypeEnum userType);

        public void setFirstName(String firstName);

        public String getFirstName();

        public CLRPUser getCurrentUser();

        public void setCurrentUser(CLRPUser currentUser);

    }
    @Name("userListAction")
    @Stateless
    @AutoCreate
    public class UserListActionImpl implements UserListAction {

        @In
        protected UserService userService;

        @Out(value = "userType", scope = ScopeType.CONVERSATION, required = false)
        private UserTypeEnum userType;

        @In
        private LoggedInUser loggedInUser;

        @Out(value = "currentUser", scope = ScopeType.CONVERSATION, required = false)
        @In(value = "currentUser", scope = ScopeType.CONVERSATION, required = false)
        private CLRPUser currentUser;   

        @In(value = "firstName", scope = ScopeType.CONVERSATION, required = false)
        private String firstName;

        /**
         * 
         */

        private static final long serialVersionUID = 8649412602585430272L;

        /*
         * (non-Javadoc)
         * 
         * @see com.ermms.clrp.user.UserAction#getUsersList()
         */


        public List<User> retrieveName() {
            System.out.print("FirstName is :" + firstName);
            return userService.getAllUsers(firstName);
        }


        public UserTypeEnum getUserType() {
            return this.userType;
        }

        public void setUserType(UserTypeEnum userType) {
            this.userType = userType;
        }

        public void setFirstName(String firstName) {
            this.firstName = firstName;
        }

        public String getFirstName() {
            return firstName;
        }

        @Override
        public CLRPUser getCurrentUser() {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public void setCurrentUser(CLRPUser currentUser) {
            // TODO Auto-generated method stub

        }
    }
@Name(“userListAction”)
@无国籍
@自动创建
公共类UserListActionImpl实现UserListAction{
@在
受保护的用户服务用户服务;
@Out(value=“userType”,scope=ScopeType.CONVERSATION,required=false)
私有用户类型枚举用户类型;
@在
私有LoggedInUser LoggedInUser;
@Out(value=“currentUser”,scope=ScopeType.CONVERSATION,required=false)
@在(value=“currentUser”,scope=ScopeType.CONVERSATION,required=false)中
私有CLRPUser currentUser;
@在(value=“firstName”,scope=ScopeType.CONVERSATION,required=false)中
私有字符串名;
/**
* 
*/
私有静态最终长serialVersionUID=8649412602585430272L;
/*
*(非Javadoc)
* 
*@see com.ermms.clrp.user.UserAction#getUsersList()
*/
公共列表检索名称(){
System.out.print(“FirstName是:“+FirstName”);
返回userService.getAllUsers(firstName);
}
公共用户类型枚举getUserType(){
返回this.userType;
}
公共void setUserType(UserTypeEnum userType){
this.userType=userType;
}
public void setFirstName(字符串firstName){
this.firstName=firstName;
}
公共字符串getFirstName(){
返回名字;
}
@凌驾
公共CLRPUser getCurrentUser(){
//TODO自动生成的方法存根
返回null;
}
@凌驾
公共无效setCurrentUser(CLRPUser currentUser){
//TODO自动生成的方法存根
}
}
控制台显示第一个名称为:null


我试了很多次,但都失去了理智。请建议我。

为什么要在
userListAction
-组件中插入
firstName
?这应该从哪里来? 如果没有更多,我想它的工作原理如下:

  • 用户输入名字并单击命令按钮
  • 表单被提交,输入的名字被使用setter方法设置到模型中
  • 执行命令按钮操作时,会发生接缝双射,并为存储在“some”上下文中的
    firstName
    注入值。由于它没有在任何地方定义,
    null
    被注入

  • 因此,如果你需要注射(在任何情况下),你应该在比赛中的任何地方输入正确的值。如果没有,只需删除注释中的

    MrD试图告诉您的是,您不需要在表单中注入每个字段。提交表单时,inputtext值将连接到UseListAction bean的firstName属性。哇。。。伟大的它很有魅力。谢谢你,MrD和Esteve。。我也为我的延误道歉。。我和其他项目有联系。。向你致敬,MrD。