added the rest chapter to the build

This commit is contained in:
Thomas Risberg 2009-04-13 17:46:21 +00:00
parent 38e5deefda
commit 19ec3654df
2 changed files with 33 additions and 31 deletions

View File

@ -230,26 +230,26 @@ public class RelativePathUriTemplateController {
<para>Here is an example configuration of a <para>Here is an example configuration of a
<classname>ContentNegotiatingViewResolver</classname></para> <classname>ContentNegotiatingViewResolver</classname></para>
<programlisting language="xml"> &lt;bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"&gt; <programlisting language="xml"> &lt;bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"&gt;
&lt;property name="mediaTypes"&gt; &lt;property name="mediaTypes"&gt;
&lt;map&gt; &lt;map&gt;
&lt;entry key="atom" value="application/atom+xml"/&gt; &lt;entry key="atom" value="application/atom+xml"/&gt;
&lt;entry key="html" value="text/html"/&gt; &lt;entry key="html" value="text/html"/&gt;
&lt;/map&gt; &lt;/map&gt;
&lt;/property&gt; &lt;/property&gt;
&lt;property name="viewResolvers"&gt; &lt;property name="viewResolvers"&gt;
&lt;list&gt; &lt;list&gt;
&lt;bean class="org.springframework.web.servlet.view.BeanNameViewResolver"/&gt; &lt;bean class="org.springframework.web.servlet.view.BeanNameViewResolver"/&gt;
&lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt; &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
&lt;property name="prefix" value="/WEB-INF/jsp/"/&gt; &lt;property name="prefix" value="/WEB-INF/jsp/"/&gt;
&lt;property name="suffix" value=".jsp"/&gt; &lt;property name="suffix" value=".jsp"/&gt;
&lt;/bean&gt; &lt;/bean&gt;
&lt;/list&gt; &lt;/list&gt;
&lt;/property&gt; &lt;/property&gt;
&lt;/bean&gt; &lt;/bean&gt;
&lt;bean id="content" class="com.springsource.samples.rest.SampleContentAtomView"/&gt;</programlisting> &lt;bean id="content" class="com.springsource.samples.rest.SampleContentAtomView"/&gt;</programlisting>
<para>The <classname>InternalResourceViewResolver</classname> handles <para>The <classname>InternalResourceViewResolver</classname> handles
the translation of view names and JSP pages while the the translation of view names and JSP pages while the
@ -290,16 +290,16 @@ public class RelativePathUriTemplateController {
<programlisting language="java">@Controller <programlisting language="java">@Controller
public class ContentController { public class ContentController {
private List&lt;SampleContent&gt; contentList = new ArrayList&lt;SampleContent&gt;(); private List&lt;SampleContent&gt; contentList = new ArrayList&lt;SampleContent&gt;();
@RequestMapping(value="/content", method=RequestMethod.GET) @RequestMapping(value="/content", method=RequestMethod.GET)
public ModelAndView getContent() { public ModelAndView getContent() {
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
mav.setViewName("content"); mav.setViewName("content");
mav.addObject("sampleContentList", contentList); mav.addObject("sampleContentList", contentList);
return mav; return mav;
} }
}</programlisting> }</programlisting>
@ -340,7 +340,7 @@ public class ContentController {
updated to support setting the HTTP method. For example, the following updated to support setting the HTTP method. For example, the following
snippet taken from the updated Petclinic sample</para> snippet taken from the updated Petclinic sample</para>
<programlisting language="html">&lt;form:form method="delete"&gt; <programlisting language="xml">&lt;form:form method="delete"&gt;
&lt;p class="submit"&gt;&lt;input type="submit" value="Delete Pet"/&gt;&lt;/p&gt; &lt;p class="submit"&gt;&lt;input type="submit" value="Delete Pet"/&gt;&lt;/p&gt;
&lt;/form:form&gt;</programlisting> &lt;/form:form&gt;</programlisting>

View File

@ -20,6 +20,7 @@
<!ENTITY mvc SYSTEM "mvc.xml"> <!ENTITY mvc SYSTEM "mvc.xml">
<!ENTITY view SYSTEM "view.xml"> <!ENTITY view SYSTEM "view.xml">
<!ENTITY web-integration SYSTEM "web-integration.xml"> <!ENTITY web-integration SYSTEM "web-integration.xml">
<!ENTITY rest SYSTEM "rest.xml">
<!ENTITY portlet SYSTEM "portlet.xml"> <!ENTITY portlet SYSTEM "portlet.xml">
<!ENTITY remoting SYSTEM "remoting.xml"> <!ENTITY remoting SYSTEM "remoting.xml">
<!ENTITY ejb SYSTEM "ejb.xml"> <!ENTITY ejb SYSTEM "ejb.xml">
@ -299,6 +300,7 @@
&mvc; &mvc;
&view; &view;
&web-integration; &web-integration;
&rest;
&portlet; &portlet;
</part> </part>
<part id="spring-integration"> <part id="spring-integration">