Tag: requestfactory

RequestFactory Entity的参数:List 在客户端上为null。 在服务器上没问题

我正在学习RequestFactory。 我有一个简单的例子。 现在我想从下面为RF实现这些实体: 服务器包 @Entity public class Pizza implements Identifiable, Versionable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Version private Long version; private String name; @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) private List ingredients; /* Getters and Setters */ } @Entity public class Ingredient implements Identifiable, Versionable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long […]

GWT RF:如何在客户端和服务器中共享相同的代码

我想使用相同的代码来排序和操作客户端和服务器端的对象。 但是我遇到了一个问题,因为在客户端我们需要一个代表服务器类的代理接口。 有没有办法在两者中使用相同的接口?我知道RF有一种机制,可以通过线路将bean属性从服务器实例复制到客户端实例。

RequestFactory:代理实现与generics的接口

我正在努力处理requestfactories和generics。 在下面的代码中,代理方法与实体方法完全匹配,但我得到了日志跟踪: java.lang.NullPointerException: null at com.google.web.bindery.autobean.vm.impl.MethodPropertyContext.traverse(MethodPropertyContext.java:102) ~[gwt-servlet-2.6.0.jar:na] at com.google.web.bindery.autobean.vm.impl.MethodPropertyContext.accept(MethodPropertyContext.java:75) ~[gwt-servlet-2.6.0.jar:na] at com.google.web.bindery.autobean.shared.impl.AutoBeanCodexImpl$PropertyCoderCreator.maybeCreateCoder(AutoBeanCodexImpl.java:353) ~[gwt-servlet-2.6.0.jar:na] at com.google.web.bindery.autobean.shared.impl.AutoBeanCodexImpl$PropertyCoderCreator.visitReferenceProperty(AutoBeanCodexImpl.java:341) ~[gwt-servlet-2.6.0.jar:na] at com.google.web.bindery.autobean.vm.impl.ProxyAutoBean.traverseProperties(ProxyAutoBean.java:324) ~[gwt-servlet-2.6.0.jar:na] at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.traverse(AbstractAutoBean.java:166) ~[gwt-servlet-2.6.0.jar:na] … 我的代理类: @ProxyFor(value = OutilLibre.class, locator = OutilLibreLocator.class) public interface OutilLibreProxy extends ProxyWithId, ProxyWithCartoLibre, EntityProxy { public Long getId(); public void setId(Long id); @Override OutilProxy getCompetence(); @Override void setCompetence(OutilProxy outil); @Override String getCompetenceAutre(); […]

GWT Maven插件 – gwt:运行但gwt:compile没有。 为什么?

我正在使用gwt-maven-plugin来管理GWT项目。 我一直使用gwt:run目标在“dev模式”下本地运行以进行测试。 我现在想将我的项目编译成一个用于在Tomcat上部署的战争。 但是,当我运行gwt:compile时,我收到编译错误,指出类路径配置问题。 一个例子: Finding entry point classes [ERROR] Errors in ‘shared.MyClass.java’ [ERROR] Line 4: The import server.model.MyObject cannot be resolved 有任何想法吗? 我是否需要手动将server包添加到某个配置文件中? 在此先感谢您的任何信息。 -tjw

GWT 2.4.0 RequestFactory多态性

GWT 2.4是否支持这种情况: @Entity class MyBase {…} @Entity class MyChild1 extends MyBase {…} @Entity class MyChild2 extends MyBase {…} … @ProxyFor(MyBase.class) class MyBaseProxy extends EntityProxy {…} @ProxyFor(MyChild1.class) class MyChild1Proxy extends MyBaseProxy {…} @ProxyFor(MyChild2.class) class MyChild2Proxy extends MyBaseProxy {…} … @Service(ArticleBase.class) public interface MyBaseRequest extends RequestContext { Request getStuff(); // MyChild1 here } … Request getStuffRequest = […]

GWT RequestFactory不持久附加实体

我正试图抓住新的RequestFactory API,并且非常艰难。 我的域模型包括Staffer , Person和Office 。 员工有一个人和一个办公室作为领域。 当我尝试将更新保存到GWT中的Staffer实例时,在服务器端persist()调用中,我在其原始/字符串字段中看到更新,但是我没有看到附加的Person或Office对象的更新。 以下是我如何影响GWT方面的编辑: private void persistStafferDetails() { CRMRequestFactory.StafferRequest stafferRequest = requestFactory.stafferRequest(); staffer = stafferRequest.edit(staffer); PersonProxy person = staffer.getPerson(); person.setFirstName(firstNameField.getText()); person.setLastName(lastNameField.getText()); staffer.setPersonalEmail(personalEmailField.getText()); staffer.getHomeLocation().setStreetAddress(addressField1.getText()); staffer.getHomeLocation().setCity(cityField.getText()); staffer.getHomeLocation().setPostalCode(postalField.getText()); staffer.getHomeLocation().setProvince(provinceDropDown.getValue(provinceDropDown.getSelectedIndex())); stafferRequest.persist().using(staffer).fire(); } 以下是代理: @ProxyFor(Staffer.class) public interface StafferProxy extends EntityProxy { Long getId(); PersonProxy getPerson(); void setPerson(PersonProxy person); OfficeProxy getOffice(); void setOffice(OfficeProxy office); String getHomePhone(); […]

GWT 2.1编辑器框架

我正在寻找有关如何使用GWT 2.1 Editor框架的一些文档或示例。 谷歌的文档是呃,有点缺乏。 从可用的有限文档中,我已经能够理解编辑器(理论上)将允许您更轻松地将GUI元素绑定到数据模型。 这将缓解将数据复制到TextArea / ListBox / CheckBox,然后将用户的更改复制回底层模型(最终是数据库)的常见任务。 如果确实能够实现这一目标,那将非常受欢迎。 就目前而言,我对于如何实施其中任何一项都感到很头疼。 任何指向文档或示例的指针都将受到高度赞赏。

Spring + GWT或Spring与GWT

背景 我正在使用GWT,Java和EclipseLink开发Web应用程序。 这些选择中的每一个都是我为实现该程序而做出的选择。 GWT是唯一没有牢牢把握它与Spring之类的东西相比的选择。 现在我使用GWT小部件来实现客户端和GWT RequestFactory来实现EclipseLink中实体的服务器 – 客户端通信。 查看 所以我认为GWT主要是一个小部件库,它有一个简单的服务器 – 客户端通信框架。 这与我查看Spring的方式大致相同,Spring是一个小部件库,具有更高级和更复杂的框架,用于控制服务器 – 客户端通信 – 有可能它不像GWT那样方便地实现AJAX。 因此,考虑到这些,我认为GWT是理解并最终与Spring合作的垫脚石。 然而,谷歌再次讨论这个话题,我遇到过像这样的一个主题,而且似乎违背了Spring的原始概念,以及这对GWT意味着什么。 问题 关于GWT和Spring的观点有误解吗? 如果是这样的话,我们将非常感谢您的一些简要指导! Spring Framework中GWT小部件的反对部分是什么? Spring Framework中GWT RequestFactory的对应部分是什么?