-
May 18th, 2011, 01:31 PM
#1
Unable to get the controller return an xml response
Hi
I have my application-context.xml configured as follows ...
<bean class="org.springframework.web.servlet.view.Conten tNegotiatingViewResolver">
<property name="mediaTypes">
<map>
<entry key="xml" value="application/xml"/>
<entry key="json" value="application/json" />
</map>
</property>
<property name="defaultViews">
<list>
<bean class="org.springframework.web.servlet.view.xml.Ma rshallingView">
<constructor-arg>
<bean class="org.springframework.oxm.xstream.XStreamMars haller">
<property name="autodetectAnnotations" value="true"/>
</bean>
</constructor-arg>
</bean>
<bean class="org.springframework.web.servlet.view.json.M appingJacksonJsonView"/>
</list>
</property>
</bean>
In my controller, I am mapping the request as follows ...
@RequestMapping(value = ("/foo.xml"), method = RequestMethod.GET)
@ResponseBody
On the browser, I call the api via http://localhost:9999/client/foo.xml?val1=bar
However, the return always sends back a json object embedded in the foo.xml response. Is there anything I miss? Please guide me.
Sincerely,
jacques83
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules