Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.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 h:inputText将空值返回到数据表中_Jsf_Jsf 2_Xhtml - Fatal编程技术网

Jsf h:inputText将空值返回到数据表中

Jsf h:inputText将空值返回到数据表中,jsf,jsf-2,xhtml,Jsf,Jsf 2,Xhtml,我相信这是一个常见的问题,但我似乎根本找不到解决办法。基本上,当我将所需的数据添加到每个输入文本框中并单击下面输入页面上的所有命令按钮时,数据不会进入指定的数据表,而是保留空值 这是用于输入这些值的xhtml代码: 请填写以下框,完成后单击保存。 身份证号码: 姓名: 发行日期: 站台: 体裁: 开发商: 出版商: 这是应显示该数据的数据表的代码: 身份证号码 #{c.ID} 名称 #{c.name} 发布日期 #{c.releaseDate} 站台 #{c.platform} 体裁 #{c

我相信这是一个常见的问题,但我似乎根本找不到解决办法。基本上,当我将所需的数据添加到每个输入文本框中并单击下面输入页面上的所有命令按钮时,数据不会进入指定的数据表,而是保留空值

这是用于输入这些值的xhtml代码:

请填写以下框,完成后单击保存。
身份证号码:
姓名:
发行日期:
站台:
体裁:
开发商:
出版商:
这是应显示该数据的数据表的代码:


身份证号码
#{c.ID}
名称
#{c.name}
发布日期
#{c.releaseDate}
站台
#{c.platform}
体裁
#{c.genre}
开发商
#{c.developer}
出版商
#{c.publisher}
行动
以及我的Java托管Bean代码:

package bean;

    import java.util.ArrayList;
    import java.util.Arrays;
    import javax.faces.bean.SessionScoped;
    import java.io.Serializable;


@Named(value = "collectors")
@SessionScoped

public class CollectorsBean implements Serializable{


    private static final long serialVersionUID = 1L;


int ID; 
String Name;
String ReleaseDate;
String Platform;
String Genre;
String Developer;
String Publisher;


public int getID() {
        return ID;
    }

public void setID(int ID) {
    this.ID = ID;
}

public String getName() {
    return Name;
}

public void setName(String Name) {
    this.Name = Name;
}

public String getReleaseDate() {
    return ReleaseDate;
}

public void setReleaseDate(String ReleaseDate) {
    this.ReleaseDate = ReleaseDate;
}

public String getPlatform() {
    return Platform;
}

public void setPlatform(String Platform) {
    this.Platform = Platform;
}

public String getGenre() {
    return Genre;
}

public void setGenre(String Genre) {
    this.Genre = Genre;
}

public String getDeveloper() {
    return Developer;
}

public void setDeveloper(String Developer) {
    this.Developer = Developer;
}

public String getPublisher() {
    return Publisher;


 }

    public void setPublisher(String Publisher) {
        this.Publisher = Publisher;
    }



  private static final ArrayList<Entry> collectionList= 
                new ArrayList<Entry>(Arrays.asList(

                new Entry (1, "Persona 5", " 4th April 2017", "Playstation 4", "Social Simulator/RolePlaying","Atlus","Deep Silver" )


                ));

    public ArrayList <Entry> getCollectionList(){

        return collectionList;
    }

    public String saveAction(){

       Entry entry = new Entry(this.ID, this.Name, this.ReleaseDate, this.Platform, this.Genre, this.Developer, this.Publisher);

        collectionList.add(entry);

        return "Collection Page.xhtml";
    }

    public String deleteAction(Entry entry) {

                collectionList.remove(entry);
        return null;
    }

    public static class Entry{

    int ID; 
    String Name;
    String ReleaseDate;
    String Platform;
    String Genre;
    String Developer;
    String Publisher;

    public Entry(int ID, String Name, String ReleaseDate, String Platform, String Genre, String Developer, String Publisher)
    {
        this.ID = ID;
        this.Name = Name;
        this.ReleaseDate = ReleaseDate;
        this.Platform = Platform; 
        this.Genre = Genre;
        this.Developer = Developer;
        this.Publisher = Publisher;


    }

     public int getID() {
        return ID;
    }

    public void setID(int ID) {
        this.ID = ID;
    }

    public String getName() {
        return Name;
    }

    public void setName(String Name) {
        this.Name = Name;
    }

    public String getReleaseDate() {
        return ReleaseDate;
    }

    public void setReleaseDate(String ReleaseDate) {
        this.ReleaseDate = ReleaseDate;
    }

    public String getPlatform() {
        return Platform;
    }

    public void setPlatform(String Platform) {
        this.Platform = Platform;
    }

    public String getGenre() {
        return Genre;
    }

    public void setGenre(String Genre) {
        this.Genre = Genre;
    }

    public String getDeveloper() {
        return Developer;
    }

    public void setDeveloper(String Developer) {
        this.Developer = Developer;
    }

    public String getPublisher() {
        return Publisher;
    }

    public void setPublisher(String Publisher) {
        this.Publisher = Publisher;
    }



    }




}
packagebean;
导入java.util.ArrayList;
导入java.util.array;
导入javax.faces.bean.SessionScoped;
导入java.io.Serializable;
@命名(value=“收集器”)
@会议范围
公共类CollectorBean实现了可序列化{
私有静态最终长serialVersionUID=1L;
int-ID;
字符串名;
字符串释放日期;
弦式平台;
弦乐体裁;
字符串显影剂;
字符串发布器;
公共int getID(){
返回ID;
}
公共无效集合ID(内部ID){
this.ID=ID;
}
公共字符串getName(){
返回名称;
}
公共void集合名(字符串名){
this.Name=Name;
}
公共字符串getReleaseDate(){
返回发布日期;
}
public void setReleaseDate(字符串ReleaseDate){
this.ReleaseDate=ReleaseDate;
}
公共字符串getPlatform(){
返回平台;
}
公共平台(字符串平台){
这个。平台=平台;
}
公共字符串getgreen(){
回归体裁;
}
公共类型(字符串类型){
这个。体裁=体裁;
}
公共字符串getDeveloper(){
归还开发商;
}
公共void setDeveloper(字符串开发人员){
this.Developer=Developer;
}
公共字符串getPublisher(){
返回出版商;
}
public void setPublisher(字符串发布器){
this.Publisher=Publisher;
}
私有静态最终ArrayList collectionList=
新建ArrayList(Arrays.asList(
新条目(1,“人物角色5”、“2017年4月4日”、“Playstation 4”、“社交模拟器/角色扮演”、“Atlus”、“深银色”)
));
公共阵列列表getCollectionList(){
回收清单;
}
公共字符串saveAction(){
Entry Entry=新条目(this.ID、this.Name、this.ReleaseDate、this.Platform、this.Genre、this.Developer、this.Publisher);
collectionList.add(条目);
返回“Collection Page.xhtml”;
}
公共字符串deleteAction(条目){
收集列表。删除(条目);
返回null;
}
公共静态类条目{
int-ID;
字符串名;
字符串释放日期;
弦式平台;
弦乐体裁;
字符串显影剂;
字符串发布器;
公共条目(int-ID、字符串名称、字符串发布日期、字符串平台、字符串类型、字符串开发人员、字符串发布者)
{
this.ID=ID;
this.Name=Name;
this.ReleaseDate=ReleaseDate;
这个。平台=平台;
这个。体裁=体裁;
this.Developer=Developer;
this.Publisher=Publisher;
}
公共int getID(){
返回ID;
}
公共无效集合ID(内部ID){
this.ID=ID;
}
公共字符串getName(){
返回名称;
}
公共void集合名(字符串名){
this.Name=Name;
}
公共字符串getReleaseDate(){
返回发布日期;
}
public void setReleaseDate(字符串ReleaseDate){
this.ReleaseDate=ReleaseDate;
}
公共字符串getPlatform(){
返回平台;
}
公共平台(字符串平台){
这个。平台=平台;
}
公共字符串getgreen(){
回归体裁;
}
公共类型(字符串类型){
这个。体裁=体裁;
}
公共字符串getDeveloper(){
归还开发商;
}
公共void setDeveloper(字符串开发人员){
this.Developer=Developer;
}
公共字符串getPublisher(){
返回出版商;
}
public void setPublisher(字符串发布器){
this.Publisher=Publisher;
}
}
}
如果有人能帮我解决这个问题,我将非常感激

请。。。并解释什么/什么地方是空的…对不起,如果