本文整理汇总了Java中ninja.params.PathParam类的典型用法代码示例。如果您正苦于以下问题:Java PathParam类的具体用法?Java PathParam怎么用?Java PathParam使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PathParam类属于ninja.params包,在下文中一共展示了PathParam类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: userDashboard
import ninja.params.PathParam; //导入依赖的package包/类
public Result userDashboard(@PathParam("email") String email,
@PathParam("id") Integer id,
Context context) {
Map<String, Object> map = new HashMap<String, Object>();
// generate tuples, convert integer to string here because Freemarker
// does it in locale
// dependent way with commas etc
map.put("id", Integer.toString(id));
map.put("email", email);
String reverseRoute = router.getReverseRoute(ApplicationController.class, "userDashboard", map);
map.put("reverseRoute", reverseRoute);
// and render page with both parameters:
return Results.html().render(map);
}
开发者ID:kpacha,项目名称:ninja-mustache,代码行数:19,代码来源:ApplicationController.java
示例2: getGroceryList
import ninja.params.PathParam; //导入依赖的package包/类
public Result getGroceryList(@PathParam("id") String id) {
Optional<GroceryList> match = repository.getList(UUID.fromString(id));
if (match.isPresent())
return json().render(match.get());
else
return notFound().render(new Message("Could not find a grocery list with id:" + id));
}
开发者ID:bentolor,项目名称:microframeworks-showcase,代码行数:8,代码来源:GroceryListController.java
示例3: updateGroceryList
import ninja.params.PathParam; //导入依赖的package包/类
public Result updateGroceryList(@PathParam("id") String id, GroceryList updatedList) {
if (repository.getList(UUID.fromString(id)).isPresent()) {
boolean ok = repository.updateList(UUID.fromString(id), updatedList);
return ok ? noContent() : badRequest().render(new Message("Update failed"));
} else
return notFound().render(new Message("Could not find a grocery list with id:" + id));
}
开发者ID:bentolor,项目名称:microframeworks-showcase,代码行数:8,代码来源:GroceryListController.java
示例4: deleteArticle
import ninja.params.PathParam; //导入依赖的package包/类
@FilterWith({ SecureFilter.class, AdminFilter.class })
public Result deleteArticle(@LoggedInUser String username,
@PathParam("id") Long id) {
if (!articleDao.removeArticle(username, id)) {
return Results.notFound();
}
return Results.noContent();
}
开发者ID:r10r-org,项目名称:doctester,代码行数:12,代码来源:ApiController.java
示例5: toggleTodoStatus
import ninja.params.PathParam; //导入依赖的package包/类
public Result toggleTodoStatus(@PathParam("id") String id) {
Todo todo = this.todoService.find(id);
todo.toggleStatus();
this.todoService.update(todo);
return Results.redirect("/");
}
开发者ID:olle,项目名称:serverside-todomvc,代码行数:9,代码来源:TodoMVCController.java
示例6: cardClicked
import ninja.params.PathParam; //导入依赖的package包/类
public Result cardClicked(Context context, @PathParam("column") int column, @PathParam("row") int row) {
this.ui.doOnCardClicked(column, row);
return Results.json().render(this.ui);
}
开发者ID:cs361fall2017,项目名称:team2,代码行数:5,代码来源:ApplicationController.java
示例7: deleteGroceryList
import ninja.params.PathParam; //导入依赖的package包/类
public Result deleteGroceryList(@PathParam("id") String id) {
boolean ok = repository.deleteList(UUID.fromString(id));
return ok ? noContent() : notFound().render(new Message("List not found"));
}
开发者ID:bentolor,项目名称:microframeworks-showcase,代码行数:5,代码来源:GroceryListController.java
示例8: indexWithLanguage
import ninja.params.PathParam; //导入依赖的package包/类
public Result indexWithLanguage(@PathParam("language") String language) {
Result result = Results.ok().html().template("/views/I18nController/index.mustache");
// This gets an url like /i18n/en
// language is then the "en" part of the url.
// We take that part and set that language as the default language
// of the framework for this user.
lang.setLanguage(language, result);
return result;
}
开发者ID:kpacha,项目名称:ninja-mustache,代码行数:14,代码来源:I18nController.java
示例9: indexWithLanguage
import ninja.params.PathParam; //导入依赖的package包/类
public Result indexWithLanguage(@PathParam("language") String language) {
Result result = Results.ok().html().template("/I18nController/index.html");
// This gets an url like /i18n/en
// language is then the "en" part of the url.
// We take that part and set that language as the default language
// of the framework for this user.
lang.setLanguage(language, result);
return result;
}
开发者ID:ninjaframework,项目名称:ninja-rythm,代码行数:14,代码来源:I18nController.java
示例10: articleShow
import ninja.params.PathParam; //导入依赖的package包/类
public Result articleShow(@PathParam("id") Long id) {
Article article = null;
if (id != null) {
article = articleDao.getArticle(id);
}
return Results.html().render("article", article);
}
开发者ID:mysu,项目名称:jade4ninja,代码行数:14,代码来源:ArticleController.java
示例11: deleteTodo
import ninja.params.PathParam; //导入依赖的package包/类
public Result deleteTodo(@PathParam("id") String id) {
this.todoService.delete(id);
return Results.redirect("/");
}
开发者ID:olle,项目名称:serverside-todomvc,代码行数:7,代码来源:TodoMVCController.java
注:本文中的ninja.params.PathParam类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论