당신은 당신의 AppModule의 RequestHandler를 서비스, 즉에 RequestFilter 기여할 수 :
public void contributeRequestHandler(
OrderedConfiguration<RequestFilter> configuration)
{
// Each contribution to an ordered configuration has a name,
// When necessary, you may set constraints to precisely control
// the invocation order of the contributed filter within the pipeline.
configuration.add("DeprecatedURLs", new RequestFilter() {
@Override
public boolean service(Request request,
Response response,
RequestHandler handler) throws IOException
{
String path = request.getPath();
if (isDeprecated(path))
{
response.sendError(404, "Not found");
return;
}
return handler.service(request, response);
}
}, "before:*");
}
가 주목하라 before:*
순서 제약, 그것은 RequestHandler
's configuration에서 처음으로이 필터를 등록해야합니다.
레거시 애플리케이션 코드에서 AppModule 또는 RequestHandler와 같은 것을 보지 못했습니다. 나는 태피스트리에 관해 정말로 모른다. TapestryFilter가 web.xml 파일에서 이와 같이 구성되어있는 것을 볼 수 있습니다. \t \t ResourcesApp \t \t <필터 클래스> org.apache.tapestry5.TapestryFilter \t \t <필터 매핑> \t \t ResourcesApp \t \t /* \t –
user1614862
그것은 '해야한다 대신 AppModule''의 ResourcesAppModule', 필터 이름을 때문에'ResourcesAp p. Tapestry에 대해 잘 모르고 "기존"앱의 작업에 대해 조금 배우고 싶지 않은 경우에는 항상 앱 앞에 Apache 또는 NGINX와 같은 HTTP 프록시를 설정하고 그 대신 사용되지 않는 URL을 처리 할 수 있습니다. –
죄송합니다. 요청하신 Tapestry 버전은 무엇입니까? –