草庐IT

Playframework

全部标签

java - hibernate 异常 : Found two representations of same collection

如果我保存一个包含以下列表的对象@OneToMany(cascade=CascadeType.ALL,mappedBy="taskList")@OrderColumn(name="position",nullable=false)publicListtasks=newArrayList();我得到异常org.hibernate.HibernateException:FoundtworepresentationsofsamecollectionPlay!中的代码Controller看起来像这样:TaskListtaskList=taskList.findById(taskListId);

java - Idea + Play Framework - 无法解析方法/符号

我使用IntelliJIDEA12,Play2.2.0,我安装了Scala插件,安装了Play2.0支持插件。我通过终端创建了javaplay应用程序(playnew)。正如您在这些图片中看到的那样,我总是收到此错误:“无法解析方法ok()”或“无法解析符号”http://sluchatka.kvalitne.cz/pics/1.pnghttp://sluchatka.kvalitne.cz/pics/2.png我整天在网上搜索这个问题,但没有找到解决方案。你能帮帮我吗? 最佳答案 第一个问题(无法解析对模板的引用)是因为您的模板目

java - 什么时候方法应该返回 Promise 而不是 Play Framework 中的实际结果?

我对PlayFramework比较陌生。我正在处理的当前项目有大量的Promise由服务层组件一直返回到Controller。我想知道这是否是最佳做法。在我看来,使用Promise确实会使源代码变得困惑。而且我不得不过于频繁地使用final修饰符,只是为了让我需要为这些Promise创建的匿名Function可以访问局部变量、参数和类成员。它甚至会影响我创建单元测试用例的方式。老实说,这感觉很丑陋,而且代码行太多了。我什至不确定我们是否做对了,我觉得我们过度使用了Promise。顺便说一句,我正在使用Java。所以,我什么时候应该使用Promise,什么时候应该返回一个Promise,

java - Play Framework : How can I read a png image using the WS client?

您好,我想从Web服务读取PNG,然后使用PNG响应客户端。(想想像图像代理之类的东西)。我在WS类中使用Java和PlayFramework2.0。目前我有:publicstaticResultgetimage(){WSRequestHolderrequestHolder=WS.url("http://someimageserver/myimage.png");PromisegetImageResult=requestHolder.get();//HowdoIcreateanplay.mvc.ResultfromthissoIcansentitbacktothecallee?}非常感

java - 如何在 Play Framework 中禁用http端口?

当我使用https端口运行PlayFramework时,应用程序在两个端口上启动-默认(9000)和https(443)。如何禁用默认的9000端口并仅在https端口上运行Play应用程序?我通过以下命令运行应用程序:play-Dhttps.port=443-Dhttps.keyStore=/path/to/keystore-Dhttps.keyStorePassword=passwordstart我得到了一些日志:[info]play-Applicationstarted(Prod)[info]play-ListeningforHTTPon/0:0:0:0:0:0:0:0:9000

java - com.sun.mail.smtp.SMTPSendFailedException : 530 5. 7.0 必须先发出 STARTTLS 命令

我正在play2.2.1中创建一个应用程序并尝试向其添加电子邮件功能。为此,我在我的build.sbt文件中添加了依赖项。但是出现了一个异常,解释如下我的代码StringsmtpHost=Play.application().configuration().getString("smtp.host");IntegersmtpPort=Play.application().configuration().getInt("smtp.port");StringsmtpUser=Play.application().configuration().getString("smtp.user");

java - 如何在 playframework 2 中构建模块

我好像找不到关于http://www.playframework.org/的说明关于为playframework2构建模块。有人知道是否有这方面的文档或构建模块所需的步骤吗?谢谢。 最佳答案 这个链接是迄今为止我所见过的最好的指南。http://java.dzone.com/articles/writing-modules-play-2-get作者Steve从事Play模块已有一段时间,并发布了一些基于他的Play1.x模块的Play2模块。 关于java-如何在playframewor

java - 从 Play 中生成的 getter 和 setter 中获益!框架

Play!frameworkgeneratesgettersandsetters对于模型类的每个公共(public)字段在运行时。publicclassProduct{publicStringname;publicIntegerprice;}将转化为publicclassProduct{publicStringname;publicIntegerprice;publicStringgetName(){returnname;}publicvoidsetName(Stringname){this.name=name;}publicIntegergetPrice(){returnprice;

java - org.hibernate.hql.ast.QuerySyntaxException : TABLE NAME is not mapped

我有两个模型,Item和ShopSection。它们之间存在多对多关系。@Entity(name="item")publicclassItemextendsModel{@ManyToMany(cascade=CascadeType.PERSIST)publicSetsections;}@Entity(name="shop_section")publicclassShopSectionextendsModel{publicListfindActiveItems(intpage,intlength){returnItem.find("selectdistinctifromItemijoin

java - 我应该使用 Play Framework 还是普通的 Java EE

关闭。这个问题是off-topic.它目前不接受答案。想改进这个问题吗?Updatethequestion所以它是on-topic用于堆栈溢出。关闭11年前。Improvethisquestion我正计划建立一个我将用于商业用途的网站。我最近听说了Play框架,看起来不错。但我不确定我是否应该使用它。我知道java、jsp、servlets和struts1.不知道那个框架的稳定性如何?我应该使用nativeJavaEE应用程序还是应该使用Play?