embedded-wireless-framework
全部标签 在built.sbt文件中有一个设置.enablePlugins(PlayScala)将我的项目设置为scala。现在我也想使用Java。我发现有两个版本的data.Form(play.data._和importplay.api.data._)。所以我为参数列表使用了完全限定类型。@(loginForm:play.data.Form[User_LoginForm])@importhelpers._@helper.form(action=routes.ApplicationJava.login(),'id->"loginForm"){@helper.inputText(loginForm
我知道您可以按照此处的建议使用ScalaAPI执行此操作:https://groups.google.com/forum/?fromgroups=#!topic/play-framework/1vNGW-lPi9I但是似乎没有办法使用Java来做到这一点,因为FakeRequests的withFormUrlEncodedBody方法只支持字符串值?这是API中缺少的功能还是有任何解决方法?(仅使用Java)。 最佳答案 对于集成测试,您可以像我一样使用apacheDefaultHttpCLient:@Testpublicvoidad
我正在编写一个play2应用程序,但我正在努力解决文件流问题。我使用具有以下签名的方法使用第三方API检索我的文件:FileMetadatagetFile(OutputStreamdestination,StringfileId)在传统的Servlet应用程序中,如果我想将内容发送到我的客户端,我会这样做:HttpServletResponseresp;myService.getFile(resp.getOutpuStream,fileId);我的问题是,在我的play2Controller类中,我无法访问底层的OuputStream,因此我的Controller方法的最简单实现是:p
我看到了一些关于此的问题,但似乎无法深入了解。我有一个PlayFramework2.3.7(Activator1.2.12)站点,当我在开发模式下运行它时一切正常。当我在生产模式下启动它时,出现以下错误:[app]$start[info]WroteC:\Users\App\git\website2.0\target\scala-2.10\app_2.10-1.0-SNAPSHOT.pom[info]MainScalaAPIdocumentationtoC:\Users\App\git\website2.0\target\scala-2.10\api...[info]Compiling5
有什么方法可以在routes文件中迭代所有描述的服务?需要URL和HTTP方法。我需要这个功能来运行一些集成测试。我正在使用PlayforJava。 最佳答案 不容易。不久前我设法破解了它(没有scala诀窍)。我会发布该代码,也许它会有用。publicstaticListparseRoutes(){scala.Optionoption=Play.application().getWrappedApplication().routes();if(option.isDefined()){play.core.Router.Routesr
我有一个这样定义的Contract类:@DocumentpublicclassContract{@IdprivateStringid;@Indexed(unique=true)privateStringref;privateStringstatus="pending";//getter&setter&hashcode&equals&tostring...}我想随时间保存契约(Contract)状态,所以我创建了一个Version类,如下所示:@DocumentpublicclassVersion{@IdprivateStringid;privateContractcontract;pr
我有一个基于SpringWeb模型-View-Controller(MVC)框架的项目。SpringWeb模型-View-Controller(MVC)框架的版本是3.2.8,部署在WebLogicServer版本:12.1.2.0.0我在1个JSP中有这个表单我使用POST方法执行了一些操作。之后我使用浏览器(IE11)后退按钮,但出现此错误WebpagehasexpiredMostlikelycause:•Thelocalcopyofthiswebpageisoutofdate,andthewebsiterequiresthatyoudownloaditagain.Somethin
我正在尝试在Win7Professional机器上使用NB7.0、JUnit和嵌入式GlassfishServer对J2EEWeb应用程序进行JUnit测试。我将其分解为仅使用单个sessionBean测试一个简单的Hello-WorldWeb应用程序。我的类路径中有glasfish-embedded-static-shell.jar,也尝试使用glassfish-embedded-all-3.1,但它也没有用。现在这是我用来测试bean的代码:importjavax.ejb.embeddable.EJBContainer;importorg.junit.AfterClass;impo
运行PlayFramework2.2.x(Java)项目时出现以下错误:ConfigurationerrorCannotregisterclass[models.SomeClass]inEbeanserver浏览器中显示的错误消息将我指向application.conf中的ebean.default="models.*"行,控制台告诉我我的一个方法中有一个java.lang.VerifyError:Badtypeonoperandstack。发生这种情况的方法没有什么特别之处,现在已经有少数方法发生了这种情况。我发现可以通过使用静态方法来避免错误:即将someObject.doJob(
我有一个现有的Play2.1项目。我一直在控制台上运行它并且运行良好。但是,当我尝试使用这些说明通过IntelliJ运行它时,它不起作用:https://www.jetbrains.com/help/idea/getting-started-with-play-2-x.html#run_debug_playApp首先,我尝试通过右键单击应用程序并选择“运行Play2应用程序”来运行它。它不会运行,它给了我这个错误:sbt.IncompatiblePluginsException:Binaryincompatibilityinpluginsdetected.在对该问题进行一些研究之后,我