在vertx-web中有什么简单的方法可以做到这一点吗?
en =英文字符,cn =简体字符,tw =繁体字符
localhost:8080/en/home
localhost:8080/cn/home
localhost:8080/tw/home
localhost:8080/en/user/mange
localhost:8080/cn/user/mange
localhost:8080/tw/user/mange有没有什么通用的方法来切换en/cn/tw本地化路径?
发布于 2018-03-27 06:45:42
实现将如下所示
Route route = router.route(HttpMethod.POST, "/:locale/home");
route.handler(routingContext -> {
String locale = routingContext.request().getParam("locale");
// Do something with them...
});
Route route = router.route(HttpMethod.POST, "/:locale/user/manage");
route.handler(routingContext -> {
String locale = routingContext.request().getParam("locale");
// Do something with them...
});https://stackoverflow.com/questions/49444937
复制相似问题