Hey there,
i am a bit lost and would be happy if anyone could help me out on this issue:
My basis is the spring-social-showcase.
I am trying to display a facebook-look-a-like feed and therefore use the getFeed() method and add it to a model within the controller class.
I can display all the data properly on the jsp, however i would like to use the thumbnail profile pictures of the users within the displayed feed.Code:@RequestMapping(value="/facebook/feed", method=RequestMethod.GET) public String showFeed(Model model) { model.addAttribute("feed", facebook.feedOperations().getFeed() ); return "facebook/feed"; }
This is part of the jsp code:
I know that application logic should be kept out of the jsp, but now i dont know where to put the logic, that connects the "getFrom()" value to the users Picture i would like to obtain from facebook.mediaOperations().Code:<div id="holder"> <c:forEach items="${feed}" var="post"> <div class="facebookContain"> <div class="facebookPhoto">PHOTO GOES HERE</div> <div class="facebookMainContent"> ${post.from.name} <div class="facebookComment">${post.message}</div> <div class="facebookControl">TIME · Like · Comment</div> <div class="facebookArrow"></div> <div class="facebookLikes"> <div class="facebookSmallLike"></div> ${post.likeCount} like this </div> <c:if test="${not empty post.comments}"> <c:forEach items="${post.comments}" var="comments"> <div class="facebookSubCommentContainer"> <div class="facebookSubCommentPhoto">PHOTO</div> <div class="facebookSubComment">${comments.from.name} ${comments.message}</div> <div class="facebookSubCommentControl">TIME · Like</div> </div> </c:forEach> </c:if> </div> </div> </c:forEach> </div>
My (i guess too simple) idea was to get the ${post.from.id} while iterating within the jsp and somehow use it to call the apropriate function from the mediaOperations() class to retrieve the image url.
However i have no idea how and where to do it (i guess not in the jsp) but rather in the controller
I would be glad for any input!Code:@RequestMapping(value="/facebook/feed", method=RequestMethod.GET) public String showFeed(Model model) { /* do something with the facebook.feedOperations().getFeed() (e.g. iterate), call mediaOperations(), merge to new object and add to model */ model.addAttribute("feed", facebook.feedOperations().getFeed() ); return "facebook/feed"; }
Thanks in advance


Reply With Quote