![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
后端开发
万年的梧桐
职业程序员爱好打球下棋
展开
-
java中json与map
@RequestBody Map<String,String> param这种写法客户端使用json传参时,如果参数中的值不是String类型,接口会报错。当参数中既有字符串又有对象时改怎么办呢。正确的写法就是 @RequestBody Map param 不指定key和value的具体类型,这样接口得到的map对象中value的类型会根据客户端实际传的值来确定我们只需要在使用的地方加上类型生命即可比如:(String)param.get("role")...原创 2021-03-19 11:50:48 · 498 阅读 · 0 评论 -
Python socket sendall 提示utf8编码问题
正常情况下,使用sendall方法发送一段内容self.client_connection.sendall(response)如果response中包含中文或其他非ascii编码的字符时,程序会抛出异常:UnicodeEncodeError: 'ascii' codec can't encode characters in position 113-114: ordinal not in range(128)原因是 sendall接收的入参是bytes类型,直接输入字符串时,会使用Py原创 2020-09-29 17:20:26 · 1579 阅读 · 0 评论 -
deploy时提示Process terminated
deploy时提示Process terminated原因是执行maven没有找到setting.xml文件:maven使用的settings文件路径,属于IDE的配置,不是工程的配置,所以切换了工程,或者工程文件路径变了,需要重新设置User settings file,这里重新指向自己项目中的settings.xml文件即可...原创 2020-08-25 11:36:26 · 2481 阅读 · 1 评论