Fixing Petclinic
This commit is contained in:
parent
a1ea7f1820
commit
c1ea5a3ab8
|
|
@ -5,7 +5,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.samples.petclinic.Clinic;
|
import org.springframework.samples.petclinic.Clinic;
|
||||||
import org.springframework.samples.petclinic.Vets;
|
import org.springframework.samples.petclinic.Vets;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
@ -55,11 +54,10 @@ public class ClinicController {
|
||||||
* @return a ModelMap with the model attributes for the view
|
* @return a ModelMap with the model attributes for the view
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/vets")
|
@RequestMapping("/vets")
|
||||||
public String vetsHandler(Model model) {
|
public ModelMap vetsHandler() {
|
||||||
Vets vets = new Vets();
|
Vets vets = new Vets();
|
||||||
vets.getVetList().addAll(this.clinic.getVets());
|
vets.getVetList().addAll(this.clinic.getVets());
|
||||||
model.addAttribute(vets);
|
return new ModelMap(vets);
|
||||||
return "vets/list";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,8 @@
|
||||||
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
|
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
|
||||||
<property name="mediaTypes">
|
<property name="mediaTypes">
|
||||||
<map>
|
<map>
|
||||||
<entry key="xml" value="application/vnd.springsource.samples.petclinic+xml"/>
|
<entry key="xml" value="#{vets.contentType}"/>
|
||||||
<entry key="atom" value="#{vets.contentType}"/>
|
<entry key="atom" value="#{visits.contentType}"/>
|
||||||
</map>
|
</map>
|
||||||
</property>
|
</property>
|
||||||
<property name="order" value="0"/>
|
<property name="order" value="0"/>
|
||||||
|
|
|
||||||
|
|
@ -741,7 +741,7 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
String requestUri = new UrlPathHelper().getRequestUri(request);
|
String requestUri = new UrlPathHelper().getRequestUri(request);
|
||||||
logger.debug("DispatcherServlet with name '" + getServletName() +
|
logger.debug("DispatcherServlet with name '" + getServletName() +
|
||||||
"' processing request for [" + requestUri + "]");
|
"' processing " + request.getMethod() + " request for [" + requestUri + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep a snapshot of the request attributes in case of an include,
|
// Keep a snapshot of the request attributes in case of an include,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue