*/
String[] splitted = req.getRequestURI().split("/");
if (splitted.length == 3) {
String tagAlias = splitted[2];
tagAlias = URLDecoder.decode(tagAlias, "UTF-8");
Tag obj = TagModel.getById(tagAlias);
if (obj != null) {
int limit = 10;
int page = 1;
try {
page = Integer.parseInt((String) req
.getParameter("page"));
} catch (Exception e) {
page = 1;
}
CompiledScript compiledscript = CompileScriptEngine
.getCompileScript(config.getApplicationId(),
"tag", template.getTag());
Bindings bind = compiledscript.getEngine().getBindings(
ScriptContext.ENGINE_SCOPE);
bind.put("title_for_layout", config.getTitle());
bind.put("description_for_layout",
config.getDescription());
bind.put("keyword_for_layout", config.getKeyword());
bind.put("css_for_layout", template.getCss());
bind.put("js_for_layout", template.getJs());
CategoryModel cateModel = new CategoryModel();
cateModel.prepareAll();
TagModel tagModel = new TagModel();
tagModel.prepareList();
bind.put("current_tag", obj);
bind.put("recent_view",
RecentViewHelper.getRecentView());
bind.put("list_tag", tagModel.getListResult());
bind.put("list_category", cateModel.getListResult());
List<News> listResult = new ArrayList<News>();
listResult = obj.recoverListNews();
int start = (page - 1) * limit;
double dLimit = limit;
bind.put("total_page",
(int) Math.ceil(listResult.size() / dLimit));
try {