我已经配置了我的过滤器,但是在Spring Security Filter链之前没有调用它.我已将订单设置为零
我正在使用Spring Boot 1.3,它支持在过滤器上设置顺序
@Bean
public FilterRegistrationBean filterRegistrationBean() {
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(new UrlRewriteFilter());
registrationBean.addUrlPatterns("*");
registrationBean.addInitParameter("confReloadCheckInterval", "5");
registrationBean.addInitParameter("logLevel", "DEBUG");
registrationBean.addInitParameter("confPath", "urlrewrite.xml");
registrationBean.setOrder(0);
return registrationBean;
}
Run Code Online (Sandbox Code Playgroud) 我最近开始使用Play!用于编写Java Web应用程序的框架(v2.0.4).在我的大多数控制器中,我遵循暂停HTTP请求的范例,直到满足Web服务响应的承诺.一旦履行承诺,我就会回复AsyncResult
.这就是我的大多数动作都是这样的(省略了一堆代码):
public static Result myActionMethod() {
Promise<MyWSResponse> wsResponse;
// Perform a web service call that will return the promise of a MyWSResponse...
return async(wsResponse.map(new Function<MyWSResponse, Result>() {
@Override
public Result apply(MyWSResponse response) {
// Validate response...
return ok(myScalaViewTemplate.render(response.data()));
}
}));
}
Run Code Online (Sandbox Code Playgroud)
我现在正在尝试国际化我的应用程序,但在尝试从async
方法渲染模板时遇到以下错误:
[error] play - Waiting for a promise, but got an error: There is no HTTP Context available from here.
java.lang.RuntimeException: There is no HTTP Context available from here.
at play.mvc.Http$Context.current(Http.java:27) ~[play_2.9.1.jar:2.0.4]
at play.mvc.Http$Context$Implicit.lang(Http.java:124) …
Run Code Online (Sandbox Code Playgroud) 我在运行通过调用dist任务创建的通用分发的linux机器上使用Play Framework 2.2.1.
我对在生产中配置应用程序的不同方面的位置和方式感到有些困惑.
我有这些文件用于配置:
application.conf
application-logger.xml
ehcache.xml
Run Code Online (Sandbox Code Playgroud)
在play framework dist任务创建的zip文件中,这些文件存在两次.
location 1:
conf/application.conf
conf/application-logger.xml
conf/ehcache.xml
location 2:
lib/myApp.myApp-1.0-SNAPSHOT.jar/application.conf
lib/myApp.myApp-1.0-SNAPSHOT.jar/application-logger.xml
lib/myApp.myApp-1.0-SNAPSHOT.jar/ehcache.xml
Run Code Online (Sandbox Code Playgroud)
事实证明,application.conf是从位置1读取的,但是application-logger.xml和ehcache.xml是从位置2读取的!
那么,为了更改调试级别,我必须更改我的分发zip的lib文件夹中的zip文件内的内容?
我做错了什么或者这个预期的设计?
谢谢!