Tube detail = TubeService.searchById(id);
List<TubeComment> comments = new ArrayList<TubeComment>();
if (detail != null) {
if (detail.getComments() != null) {
for (Text cmtText : detail.getComments()) {
TubeComment tubeComment = new TubeComment();
tubeComment.transformText(cmtText.getValue());
comments.add(tubeComment);
}
}
request.setAttribute("detail", detail);
request.setAttribute("url", request.getRequestURL());