Skip to content
Browse files

Testing reviews.

  • Loading branch information...
1 parent d703ebc commit e2df3e372ab8115fca77bee80b211eb59007a30a Mike Chandler committed
View
1 src/main/java/com/rmwebfx/citygridsearch/controller/PlacesController.java
@@ -18,6 +18,7 @@ public String getPlace(@PathVariable("locationId") int locationId,
Place place = new Place(locationId);
model.addAttribute("locationName", place.getName());
model.addAttribute("publicId", place.getPublicId()); //TODO: remove this
+ model.addAttribute("reviews", place.getReviews());
return "place";
}
View
4 src/main/java/com/rmwebfx/citygridsearch/resources/Place.java
@@ -112,6 +112,10 @@ public PlaceAddress getAddress() {
return address;
}
+ public List<Review> getReviews() {
+ return reviews;
+ }
+
public void setAllReviews() {
CGBaseReview[] allReviews = locationObj.getReviews().getReviews();
reviews = new ArrayList<Review>();
View
9 src/main/webapp/WEB-INF/views/place.jsp
@@ -1,5 +1,8 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
+<%@ page import="com.rmwebfx.citygridsearch.resources.Review" %>
+<%@ page import="java.util.List" %>
+<%@ page import="java.util.ArrayList" %>
<html>
<head>
<title>Place</title>
@@ -8,5 +11,11 @@
<h1>Place Details</h1>
<h4><c:out value="${locationName}"></c:out> (<c:out value="${publicId}"></c:out>)</h4>
+
+ <%
+ List<Review> reviews = (ArrayList<Review>) request.getAttribute("reviews");
+ %>
+
+ <p><%= reviews.get(0).getTitle() %></p>
</body>
</html>

0 comments on commit e2df3e3

Please sign in to comment.
Something went wrong with that request. Please try again.