BAEL-1275 Introduction to ActiveWeb (#3638)

* BAEL-1275 Introduction to active web first commit

* BAEL-1275 Added the module to parent pom

* BAEL-1275 Introduction to ActiveWeb
This commit is contained in:
Dhrubajyoti Bhattacharjee
2018-02-24 12:48:53 +05:30
committed by Grzegorz Piwowarek
parent 2399b4d817
commit d7aecc83de
18 changed files with 277 additions and 11 deletions

View File

@@ -0,0 +1,28 @@
package app.controllers;
import javax.inject.Inject;
import org.javalite.activeweb.AppController;
import app.services.ArticleService;
public class ArticleController extends AppController {
@Inject
private ArticleService articleService;
public void index() {
view("articles", articleService.getArticles());
}
public void search() {
String keyword = param("key");
if (null != keyword) {
assign("article", articleService.search(keyword));
} else {
render("/common/error");
}
}
}