input type=checkbox的值后台怎么接受

input type=checkbox的值是on或off

实体类中这样写即可

    public void setChapterVisibility(Object chapterVisibility) {
        if (chapterVisibility.equals("on"))
            this.chapterVisibility = 1;
        else if (chapterVisibility.equals("off"))
            this.chapterVisibility = 0;
        else
            this.chapterVisibility = (int) chapterVisibility;
    }