Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/339.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 此XML文件似乎没有任何与之关联的样式信息。文档树如下所示_Java_Html_Spring_Spring Mvc - Fatal编程技术网

Java 此XML文件似乎没有任何与之关联的样式信息。文档树如下所示

Java 此XML文件似乎没有任何与之关联的样式信息。文档树如下所示,java,html,spring,spring-mvc,Java,Html,Spring,Spring Mvc,我正在使用SpringMVC。从客户端到控制器,我使用下面的xml进行了PUT <http-request method="PUT" url="/serviceproviders/{sp_id}/accessNumbers/{new_an_id}/languages" mime="application/xml"> <content> <![CDATA[ <additionalLanguages xmlns="

我正在使用SpringMVC。从客户端到控制器,我使用下面的xml进行了PUT

<http-request method="PUT" url="/serviceproviders/{sp_id}/accessNumbers/{new_an_id}/languages" mime="application/xml">
        <content>
        <![CDATA[
         <additionalLanguages xmlns="http://www.XXX.com/pcs/model/schemas">
         <additionalLangIds>1003</additionalLangIds>
         </additionalLanguages>
        ]]>
        </content>
控制器正在返回的视图 “org.springframework.web.servlet.view.RedirectView”。 这个视图本质上是为相同的url“/serviceproviders/{sp_id}/accessNumbers/{new_an_id}/languages”调用GET,它返回AdditionalLanguages类的实例

最后,我希望在浏览器“1003”中收到一个响应,它只是

<HTML>
<BODY>
<additionalLanguages xmlns="http://www.XXX.com/pcs/model/schemas">
<additionalLangIds>1003</additionalLangIds>
</additionalLanguages>
</BODY>
</HTML>
我的问题是为什么输出不是一个值?为什么是XML? 我在这里错过了什么

请帮帮我。我挣扎了很长时间。你是我唯一的希望


分辨率

仅在直接从控制器返回值(对象)时添加@ResponseBy。如果您正在执行重定向url;不要添加此注释。

控制器的输出看起来非常有效-从您的描述来看,您的“PUT”请求工作正常,返回了RedirectView,在redirected方法中,它返回了“AdditionalLanguages”,我假设您已使用@ResponseBy进行了注释,这就是Spring使用MessageConverter(在本例中为Jaxb)将AdditionAllLanguages响应转换为XML的原因

简而言之,输出是一个值,因为您可能已经将重定向视图中的响应映射到@ResponseBody

rfc include='reference.I-D.ietf-anima-grass'?>
rfc include='reference.I-D.ietf-anima-grasp'?> 
<?rfc include='reference.I-D.greevenbosch-appsawg-cbor-cddl'?> 
<?rfc include='reference.I-D.ietf-anima-bootstrapping-keyinfra'?> 
<?rfc include='reference.I-D.ietf-anima-autonomic-control-plane'?> 
<?rfc include='reference.RFC.3633'?> 
</references> <references title="Informative References"> 
<?rfc include='reference.RFC.2629'?> 
<?rfc include='reference.RFC.7575'?> 
<?rfc include='reference.RFC.7576'?> 
<?rfc include='reference.I-D.ietf-anima-reference-model'?> 
</references> 
</back> 
</rfc

为什么要添加SOAP标签?这似乎与肥皂无关。
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<additionalLanguages xmlns="http://www.radisys.com/pcs/model/schemas">
<additionalLangIds>1003</additionalLangIds>
</additionalLanguages>
Execute action [repitition=0]: PUT -http://{SERVER}/PcsRESTApi/serviceproviders/1/accessNumbers/2020/languages
---HTTP RESPONSE---
HTTP Status: 500 - Internal Server Error
Response Headers:
  Date=Sat, 07 Jul 2012 23:19:45 GMT
  Server=Apache/2.2.16 (Unix) mod_jk/1.2.28
  errorCode=unknown
  errorMessage=Could not find acceptable representation
  Accept-Charset=big5, big5-hkscs, compound_text, euc-jp, euc-kr, gb18030, gb2312, gbk, ibm-thai, ibm00858, ibm01140, ibm01141, ibm01142, ibm01143, ibm01144, ibm01145, ibm01146, ibm01147, ibm01148, ibm01149, ibm037, ibm1026, ibm1047, ibm273, ibm277, ibm278, ibm280, ibm284, ibm285, ibm297, ibm420, ibm424, ibm437, ibm500, ibm775, ibm850, ibm852, ibm855, ibm857, ibm860, ibm861, ibm862, ibm863, ibm864, ibm865, ibm866, ibm868, ibm869, ibm870, ibm871, ibm918, iso-2022-cn, iso-2022-jp, iso-2022-jp-2, iso-2022-kr, iso-8859-1, iso-8859-13, iso-8859-15, iso-8859-2, iso-8859-3, iso-8859-4, iso-8859-5, iso-8859-6, iso-8859-7, iso-8859-8, iso-8859-9, jis_x0201, jis_x0212-1990, koi8-r, koi8-u, shift_jis, tis-620, us-ascii, utf-16, utf-16be, utf-16le, utf-32, utf-32be, utf-32le, utf-8, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257, windows-1258, windows-31j, x-big5-solaris, x-euc-jp-linux, x-euc-tw, x-eucjp-open, x-ibm1006, x-ibm1025, x-ibm1046, x-ibm1097, x-ibm1098, x-ibm1112, x-ibm1122, x-ibm1123, x-ibm1124, x-ibm1381, x-ibm1383, x-ibm33722, x-ibm737, x-ibm834, x-ibm856, x-ibm874, x-ibm875, x-ibm921, x-ibm922, x-ibm930, x-ibm933, x-ibm935, x-ibm937, x-ibm939, x-ibm942, x-ibm942c, x-ibm943, x-ibm943c, x-ibm948, x-ibm949, x-ibm949c, x-ibm950, x-ibm964, x-ibm970, x-iscii91, x-iso-2022-cn-cns, x-iso-2022-cn-gb, x-iso-8859-11, x-jis0208, x-jisautodetect, x-johab, x-macarabic, x-maccentraleurope, x-maccroatian, x-maccyrillic, x-macdingbat, x-macgreek, x-machebrew, x-maciceland, x-macroman, x-macromania, x-macsymbol, x-macthai, x-macturkish, x-macukraine, x-ms950-hkscs, x-mswin-936, x-pck, x-utf-16le-bom, x-utf-32be-bom, x-utf-32le-bom, x-windows-50220, x-windows-50221, x-windows-874, x-windows-949, x-windows-950, x-windows-iso2022jp
  Content-Length=5243
  Connection=close
  Content-Type=application/xml
Response Body:
unknown: Could not find acceptable representation
org.springframework.web.HttpMediaTypeNotAcceptableException Could not find acceptable representation
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ServletHandlerMethodInvoker.writeWithMessageConverters(AnnotationMethodHandlerAdapter.java:954)
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ServletHandlerMethodInvoker.handleResponseBody(AnnotationMethodHandlerAdapter.java:898)
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ServletHandlerMethodInvoker.getModelAndView(AnnotationMethodHandlerAdapter.java:847)
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:423)
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:409)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:774)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
rfc include='reference.I-D.ietf-anima-grasp'?> 
<?rfc include='reference.I-D.greevenbosch-appsawg-cbor-cddl'?> 
<?rfc include='reference.I-D.ietf-anima-bootstrapping-keyinfra'?> 
<?rfc include='reference.I-D.ietf-anima-autonomic-control-plane'?> 
<?rfc include='reference.RFC.3633'?> 
</references> <references title="Informative References"> 
<?rfc include='reference.RFC.2629'?> 
<?rfc include='reference.RFC.7575'?> 
<?rfc include='reference.RFC.7576'?> 
<?rfc include='reference.I-D.ietf-anima-reference-model'?> 
</references> 
</back> 
</rfc