francofabio / vraptor-jackson-serializer Goto Github PK
View Code? Open in Web Editor NEWVRaptor plugin for JSON serialization using jackson library (http://jackson.codehaus.org/)
VRaptor plugin for JSON serialization using jackson library (http://jackson.codehaus.org/)
Como utilizar este plugin?
Eu preciso receber, em meu controller um JSON, mas não faço ideia de como utilizar este componente.
Existe algum exemplo disponível?
Encontrei um problema ao tentar serializar um objeto que possuia atributos mas não possuia getter method respectivo atributo. A exceção ocorre aqui no momento da serialização.
Note que a reflexão é feita aqui usando o atributo e não o getter method.
A solução é utilizar nos dois lugares ou o getter method ou o field
A linha abaixo...
result.use(Results.json()).withoutRoot().from(produtos).serialize();
retorna...
{"productList":[{"id":1,"name":"Product 1","creationDate":"2013-04-30"},{"id":2,"name":"Product 2","creationDate":"2013-04-30"}]}
mas deveria retornar...
{[{"id":1,"name":"Product 1","creationDate":"2013-04-30"},{"id":2,"name":"Product 2","creationDate":"2013-04-30"}]}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.