开发者

REST API (xml and json) formating with Play Framework

开发者 https://www.devze.com 2023-04-12 08:11 出处:网络
I have a simple model class with several attribut. @Column(length = 50, nullable = false) @Required @MaxSize(50)

I have a simple model class with several attribut.

@Column(length = 50, nullable = false)
@Required
@MaxSize(50)
public String name;

@Column(length = 50)
@MaxSize(50)
public String coordGeo; //geographic coordinate

When I expose it in different format (xml and Json) I have a formating problem with my attribut. In Json and XML render I have a problem with my name attribut (I have an empty space) :

{"name":"Hôtel de Ville                开发者_开发知识库                    "}

<slotname>Hôtel de Ville                                    </slotname>

and for coordGeo I have this (only with renderJSON) :

"\"46°9\u002735.719\"\"N,1°9\u00274.720\"\"W\""

but I want this :

"46°9'35.719""N,1°9'4.720""W"

How do I fix this errors ? Thanks for reply.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号