@Action(value = "?article.id=$1&pg=$3", rest = "/article/(\\d+)(/(\\d+))?")
public Object html() throws SQLException {
article = qr.query("select * from Article where id=?", new BeanHandler<Article>(Article.class), article.id);
if (article == null) {
return new ErrorResult(404);
}
qr.update("update Article set view=view+1 where id=?", article.id);
user = qr.query("select * from User where id=?", new BeanHandler<User>(User.class), article.authorId);
if (user == null) {
return new ErrorResult(404);
}
String[] tags = article.getTagList();
if (tags.length > 0) {
tag = tags[0];
}