继之前执行的过程是我所创建的路线 -Apache的骆驼 - 每个路由
from("jetty:http://localhost:8181/abc").routeId("abc").choice()
// Authenticate the request
.when(authenticator).endChoice()
// Authorize the request
.when(authorizer).endChoice()
// Validate the request
.when(abcValidator).endChoice()
.otherwise()
.process(abcRequestProcessor).process(storeFeatureRequestDetails).process(featureRequestApproverUpdater).split(body()).process(abcApproverMailer).to("direct:toMail");
上述路线的功能,但我不想认证和授权的步骤添加到每一个路线。有没有一种方法可以将它们配置为在每条路线之前运行。
我尝试以下 -
from("jetty:http://localhost:8181/*").process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
System.out.println("Triggered");
}
});
但它看起来完全匹配。
或多或少相同。我们仍然需要添加to的。不要我们有像struts中可用的拦截器。 – user1305398
搜索网站,你可以找到有关拦截器的信息 - 骆驼头版上有一个搜索框。 –