【问题标题】:sending large text message to Spring MVC Restful service向 Spring MVC Restful 服务发送大文本消息
【发布时间】:2013-03-25 20:39:04
【问题描述】:

我正在使用 Spring MVC RESTful 服务,我从前端捕获包含 \ 和 & 等字符的大文本消息,并且我的控制器对大文本消息抛出错误 我遇到了错误

    SEVERE: Servlet.service() for servlet [validate_webservice] in context with path [/validate_webservice] threw exception [Request processing failed; nested exception is ca.uhn.hl7v2.parser.EncodingNotSupportedException: Determine encoding for message. The following is the first 50 chars of the message for reference, although this may not be where the issue is: MSH|^~\\] with root cause

ca.uhn.hl7v2.parser.EncodingNotSupportedException:确定消息的编码。以下是消息的前 50 个字符以供参考,尽管这可能不是问题所在:MSH|^~\

如何成功传递大而复杂的字符串值?

【问题讨论】:

    标签: spring rest


    【解决方案1】:

    尝试将 CDATA 放在大文本中,以避免在内容中解析 XML。然后你可以在你的内容中使用像“

    <![CDATA[ your large complex string values with & < and &.... ]]>
    

    更多信息http://www.w3schools.com/xml/xml_cdata.asp

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-31
      • 2023-03-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多