2013-03-25 70 views
0

我使用的是Spring MVC RESTful服務,我從前端捕獲包含\ \,&等字符的大文本消息,我的控制器爲大文本消息拋出錯誤 我得到低於錯誤發送大文本消息到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 | ^〜\

如何成功傳遞大型複雜字符串值?

回答

1

嘗試將CDATA放入大文本中以避免在內容中解析XML。然後你可以使用的字符,如「<」和「&」 ......在你的內容:

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

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