草庐IT

ios-universal-framework

全部标签

java - Play Framework 路线不工作

我只是想按照PlayFramework的ZenTasks教程(http://www.playframework.com/documentation/2.1.0/JavaGuide4)进行操作。然而,我似乎甚至无法让登录页面正常工作。我正在使用play~run命令运行这个项目。当导航到http://localhost:9000/login时,错误是ActionnotfoundForrequest'GET/login'Theserouteshavebeentried,inthisorder:1GET/controllers.Application.index()2GET/assets/$f

Java servlet 和 IO : Create a file without saving to disk and sending it to the user

我希望可以帮助我解决文件创建/响应问题。我知道如何创建和保存文件。我知道如何通过ServletOutputStream将该文件发送回用户。但我需要的是创建一个文件,而不是将其保存在磁盘上,然后通过ServletOutputStream发送该文件。上面的代码解释了我拥有的部分。任何帮助表示赞赏。提前致谢。//ThisCreatesafile//Stringtext="Thesedaysrunawaylikehorsesoverthehill";Filefile=newFile("MyFile.txt");Writerwriter=newBufferedWriter(newFileWrit

带有 paho 的 java.io.EOFException

我想对mosquitto进行压力测试,所以我创建了一些代码如下for(inti=0;i但是,我在运行期间遇到了一些错误,例如EOFException并且某些客户端断开连接。我想知道一台mosquitto服务器可以同时发布多少个客户端消息,压力测试如何进行。谢谢!详细异常是:Connectionlost(32109)-java.io.EOFExceptionatorg.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:162)atjava.lang.Thread.run(Thread.java

Java:BufferedReader readLine() 中的 IO 异常有什么用?

我可以用try-catch循环“修复”下面的异常,但我不明白原因。为什么“in.readLine()”部分不断引发IOExceptions?抛出此类异常的真正目的是什么,目标可能不仅仅是更多的副作用?代码和IOExceptions$javacReadLineTest.javaReadLineTest.java:9:unreportedexceptionjava.io.IOException;mustbecaughtordeclaredtobethrownwhile((s=in.readLine())!=null){^1error$catReadLineTest.javaimportja

java - Play Framework 2.4 不接受 Controller 的 "public static Result"

我尝试在Mac中使用PlayFramework2.4和JDK8启动应用程序,当我使用./activatornewProjectplay-java下载基础时,模板代码包含下一个:项目/app/controlles/Application.javapackagecontrollers;importplay.*;importplay.mvc.*;importviews.html.*;publicclassApplicationextendsController{publicResultindex(){returnok(index.render("Yournewapplicationisrea

java - ExceptionConverter : java. io.IOException : The document has no pages. 我正在使用 iText

当我执行下面的代码时Filef=newFile("c:/sample.pdf");PdfWriter.getInstance(document,newFileOutputStream(f));document.open();System.out.println("openingthedocument..");PdfPTableheaderTable=newPdfPTable(9);PdfPCellcellValue=newPdfPCell(newParagraph("Header1"));cellValue.setColspan(1);headerTable.addCell(cellV

java - Play Framework 中的完整目标/当前 URL?

关于如何使用play框架获取当前URL的任何想法?我也在寻找完整的目标URL。我知道我可以使用@{Controller.method}但我需要完整的url(对于Facebook点赞按钮) 最佳答案 使用@@创建绝对路径所以,你会使用@@{Controller.method}但是,要获取当前路径,无需指定特定的Controller和操作,您可以使用${request.url} 关于java-PlayFramework中的完整目标/当前URL?,我们在StackOverflow上找到一个类似

java - 即使在简单的 POJO Java 类中实现 java.io.Serializable 也是最佳实践吗?

一般来说,让简单的POJOJava类实现java.io.Serializable是最佳实践吗? 最佳答案 一般不会。约书亚布洛赫说implementSerializablejudiciously.他描述的缺点总结:降低了以后更改类实现的灵active-序列化形式是类API的一部分更有可能出现一些错误和安全漏洞-攻击者可以访问序列化字节流中的类内部增加了测试负担-现在您必须测试序列化!负担子类的作者——他们也必须使他们的子类可序列化当然,有时您需要一个POJO来实现可序列化,例如RMI,但如果不需要,没有它您的代码会更简单、更安全。

java - Play Framework : PersistenceException: The type is not a registered entity? (Ebean)

我正在学习适用于Java的PlayFramework2.0教程,但在尝试保存ebean模型(task.save())时遇到此错误。[PersistenceException:Thetype[classmodels.Task]isnotaregisteredentity?Ifyoudon'texplicitlylisttheentityclassestouseEbeanwillsearchforthemintheclasspath.IftheentityisinaJarchecktheebean.search.jarspropertyinebean.propertiesfileorche

现有文件上的 java.io.FileNotFoundException

当我尝试打开文件时出现此错误:java.io.FileNotFoundException:D:\Portable%20Programs\Android%20Development\workspace3\XXX-desktop\bin\World_X.fr(Thesystemcannotfindthepathspecified)atjava.io.FileInputStream.open(NativeMethod)atjava.io.FileInputStream.(UnknownSource)atjava.util.Scanner.(UnknownSource)该文件存在于目录中,但我