草庐IT

application-framework

全部标签

java - 注释 "not applicable to type"

多年来我一直是IntelliJ的Eclipse用户,所以我真的发现了这个错误,所有对@Override的注释都显示错误“notapplicabletotype”例如,来自JBossErrai的@PostConstruct注释到处都显示此错误,其中导入完全没有错误。我该如何解决这个问题?更新:例如@PostConstruct//Whenhoveredwiththemousepointer'@PostContruct'isnotapplicabletomethodpublicvoidinit(){}截图:http://snag.gy/q5cW5.jpg 最佳答案

java - Spring Security 5 在 Application Runner 中调用 OAuth2 Secured API 导致 IllegalArgumentException

给定以下代码,是否可以在应用程序运行器中调用受客户端凭据保护的API?@BeanpublicApplicationRunnertest(WebClient.Builderbuilder,ClientRegistrationRepositoryclientRegistrationRepo,OAuth2AuthorizedClientRepositoryauthorizedClient){returnargs->{try{varoauth2=newServletOAuth2AuthorizedClientExchangeFilterFunction(clientRegistrationRe

java - 如何使用 Java 在 Play Framework 2.0 中测试文件上传的多部分表单数据请求?

我知道您可以按照此处的建议使用ScalaAPI执行此操作:https://groups.google.com/forum/?fromgroups=#!topic/play-framework/1vNGW-lPi9I但是似乎没有办法使用Java来做到这一点,因为FakeRequests的withFormUrlEncodedBody方法只支持字符串值?这是API中缺少的功能还是有任何解决方法?(仅使用Java)。 最佳答案 对于集成测试,您可以像我一样使用apacheDefaultHttpCLient:@Testpublicvoidad

java - 使用 Play Framework 和第三方 API 流式传输大文件

我正在编写一个play2应用程序,但我正在努力解决文件流问题。我使用具有以下签名的方法使用第三方API检索我的文件:FileMetadatagetFile(OutputStreamdestination,StringfileId)在传统的Servlet应用程序中,如果我想将内容发送到我的客户端,我会这样做:HttpServletResponseresp;myService.getFile(resp.getOutpuStream,fileId);我的问题是,在我的play2Controller类中,我无法访问底层的OuputStream,因此我的Controller方法的最简单实现是:p

java - Play Framework 2.3.7 : Static assets location not working in production

我看到了一些关于此的问题,但似乎无法深入了解。我有一个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

java - 在测试中迭代所有 Play Framework 路由

有什么方法可以在routes文件中迭代所有描述的服务?需要URL和HTTP方法。我需要这个功能来运行一些集成测试。我正在使用PlayforJava。 最佳答案 不容易。不久前我设法破解了它(没有scala诀窍)。我会发布该代码,也许它会有用。publicstaticListparseRoutes(){scala.Optionoption=Play.application().getWrappedApplication().routes();if(option.isDefined()){play.core.Router.Routesr

java - Spring Framework MVC 中的 "Webpage has expired"

我有一个基于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

java - 无法在 Ebean 服务器中注册类(Play Framework 2 - Java)

运行PlayFramework2.2.x(Java)项目时出现以下错误:ConfigurationerrorCannotregisterclass[models.SomeClass]inEbeanserver浏览器中显示的错误消息将我指向application.conf中的ebean.default="models.*"行,控制台告诉我我的一个方法中有一个java.lang.VerifyError:Badtypeonoperandstack。发生这种情况的方法没有什么特别之处,现在已经有少数方法发生了这种情况。我发现可以通过使用静态方法来避免错误:即将someObject.doJob(

java - 如何在 Java Jersey Application 中使用查询参数?

我正在学习教程并使用了Stackoverflow问题here.这是我的Java类:packagecom.crunchify.tutorial;importjavax.ws.rs.DefaultValue;importjavax.ws.rs.GET;importjavax.ws.rs.Path;importjavax.ws.rs.Consumes;importjavax.ws.rs.QueryParam;importjavax.ws.rs.core.Context;importjavax.ws.rs.core.MediaType;importjavax.ws.rs.core.Multiv

java - 如何在 IntelliJ 中运行 Play Framework 2.1 项目?

我有一个现有的Play2.1项目。我一直在控制台上运行它并且运行良好。但是,当我尝试使用这些说明通过IntelliJ运行它时,它不起作用:https://www.jetbrains.com/help/idea/getting-started-with-play-2-x.html#run_debug_playApp首先,我尝试通过右键单击应用程序并选择“运行Play2应用程序”来运行它。它不会运行,它给了我这个错误:sbt.IncompatiblePluginsException:Binaryincompatibilityinpluginsdetected.在对该问题进行一些研究之后,我