Permalink
Browse files

Modifications to controller and associated view changes.

  • Loading branch information...
1 parent df6e461 commit d9e963dc813f4b028170d05063a0fd5bc07c2284 Mike Chandler committed Mar 22, 2012
@@ -18,8 +18,7 @@ public ModelAndView getPlace(@PathVariable("locationId") int locationId,
view.setViewName("place");
Place place = new Place(locationId);
- view.addObject("locationName", place.getName());
- view.addObject("reviews", place.getReviews());
+ view.addObject("place", place);
return view;
}
@@ -1,21 +1,23 @@
<%@ 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>
</head>
<body>
<h1>Place Details</h1>
- <h4><c:out value="${locationName}"></c:out></h4>
+ <h4><c:out value="${place.getName()}"></c:out></h4>
- <%
- List<Review> reviews = (ArrayList<Review>) request.getAttribute("reviews");
- %>
+ <p><c:out value="${place.getAddress().getStreet()}" /><br/>
+ <c:out value="${place.getAddress().getCity()}" />, <c:out value="${place.getAddress().getState()}" /> <c:out value="${place.getAddress().getPostal()}" /><br />
+ <c:out value="${place.getPhone()}" /></p>
- <p><b><%= reviews.get(0).getTitle() %></b><br/><%= reviews.get(0).getText() %></p>
+ <h5>Reviews</h5>
+
+ <c:forEach var="review" items="${place.getReviews()}">
+ <b><c:out value="${review.getTitle()}" /></b><br />
+ <c:out value="${review.getText()}"></c:out><br /><br />
+ </c:forEach>
</body>
</html>

0 comments on commit d9e963d

Please sign in to comment.