java - 是否有任何 "modern"框架支持在编译时检查数据绑定(bind)?

标签 java web frameworks jvm

这是这个问题的后续:Are there any web frameworks for JVM with data binding checked at compilation time?

在那个问题中,公认的答案是 JSP。

我的问题是,是否有任何现代框架(如 Wicket、Play 2.0、Spring MVC、Vaadin、Grails、Tapestry、JSF、GWT 等)支持此编译时绑定(bind)功能?

我知道新手开发者更喜欢没有任何编译时检查的动态绑定(bind),因此该功能已从大多数现代语言和框架中删除。我只想知道他们中是否有任何人保留了对这个特定旧功能的支持,即使它作为一个选项得到支持。

最佳答案

据我所知,Vaadin 8 支持这种与 Java lambda 表达式的绑定(bind)。

Binder<Person> binder = new Binder<>();

TextField titleField = new TextField();

// Start by defining the Field instance to use
binder.forField(titleField)
  // Finalize by doing the actual binding to the Person class
  .bind(
    // Callback that loads the title from a person instance
    Person::getTitle,
    // Callback that saves the title in a person instance
    Person::setTitle));

有关详细信息,请参阅文档:https://vaadin.com/docs/framework/datamodel/datamodel-forms.html

关于java - 是否有任何 "modern"框架支持在编译时检查数据绑定(bind)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24962609/

相关文章:

Java 在静态方法中读取文件,使用 ClassLoader 给出 FileNotFoundException

java - 当集合没有重写 toString() 时,如何打印集合子类内容?

java - eclipse插件: perspective deprecated in shortcut

java - Java 的 Enum<?> 是什么意思?为什么它与 Enum 不兼容?

Firefox 不加载 iframe 内容

html - 让下划线淡入的问题

ios - 从 Web 链接下载应用程序

ios - Pod 更新后编译 Swift 3.0.1 项目时出错

javascript - SproutCore 和 Cappuccino

c# - 首先使用 Try Catch 或检查值