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

问题描述:

前端一个字段

<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" 编码属性



转载于:https://www.cnblogs.com/prettrywork/p/11536508.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值