我在尝试传递用户界面中输入的值时遇到了一些问题。到数据库中的特定表和列,但是当我提交要传递的值时,我收到错误
WARNING: #{markingBean.markSectionOne}: java.lang.UnsupportedOperationException: Not supported yet.
javax.faces.FacesException: #{markingBean.markSectionOne}: java.lang.UnsupportedOperationException: Not supported yet.
在 glassfish 控制台
我正在使用 netbeans、jsf、derby db
<p:spinner id="ajaxspinner80-100" value="#{markingBean.spinnerNumber1}"
stepFactor = "1" min="80" max="100" disabled = "#{formBean.number != 8}">
<p:ajax update="ajaxspinnervalue" process="@this" />
</p:spinner>
<p:commandButton action="#{markingBean.markSectionOne}" value="#{bundle.buttonSave}" update=":growl" icon="ui-icon-disk"/>
上面是用户选择值然后将其传递给 bean 的方式:
public void markSectionOne() {
this.markToCreate.create(this.markToCreate);
}
但是看起来这就是错误的原因
public void create(Marking markToCreate) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
我在我的标记实体类的底部找到了该代码,
我的问题是如何将微调器中的值插入到 markSectionOne 列下的表格标记中?
谢谢
最佳答案
您需要 UI 和数据库之间的中介。您永远不应该将其视为“旋转到我的表格中”或任何其他 UI 元素。
分步骤进行:
- 将 UI 表单 POST 到中介。验证并绑定(bind)传入的数据。
- 处理传入数据并保留。
关于java - 将数据从 UI 传递到数据库时出现问题 - JSF、JPA 等,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21882974/