Coder Social home page Coder Social logo

vraptor-jackson-serializer's Introduction

ABOUT

VRaptor plugin for JSON serialization and deserialization using jackson library (http://jackson.codehaus.org)

CONFIGURATION

  1. Add this dependency in your project:

    groupId: com.github.francofabio
    artifactId: vraptor-jackson-serializer
    version: 1.0.7 or (last release)

  2. Add this parameter in your web.xml:

     <context-param>
         <param-name>br.com.caelum.vraptor.packages</param-name>
         <param-value>com.github.francofabio.vraptor.jackson.serialization,com.github.francofabio.vraptor.jackson.deserialization</param-value>
     </context-param>
    

vraptor-jackson-serializer's People

Contributors

francofabio avatar rogeriolacerda avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

marceloemanoel

vraptor-jackson-serializer's Issues

Método withoutRoot() ignorado para Collection

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"}]}

Problema ao serializar um objeto com atributos sem gettter methods

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

Exemplo de utilização

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.