springmvc 后台实体类接受前端json字符串时,其中一个属性content 接受富文本内容时 标签<p>、<span> 这些标签丢失问题解决

混江龙づ霸主 提交于 2019-11-29 21:57:51

问题描述:

前端一个字段

<script id="editor" type="text/plain" name="content" style="width:600px;height:400px;border-radius: 3px;" >$content!}</script>向后台传该富文本值是 前端控制台打印内容如下<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: rgb(151, 72, 6);"> &nbsp;<span style="color: rgb(151, 72, 6); font-size: 20px;">大师傅的阿萨德</span></span></p>属于完整的带有标签的内容但是后台使用实体类接受时候 实体类属性content 只有
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;大师傅的阿萨德所有的标签丢失  不会报错,找了一整天问题所在,也怀疑了狠狠多多地方,结果都不是究其问题所在:前端form表的缺少  enctype="multipart/form-data" 编码属性

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!