Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-10768

Spring dependency injection for Jackson serializers

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.2.3
    • Fix Version/s: 4.1.3
    • Component/s: Core
    • Labels:
    • Last commented by a User:
      true

      Description

      Spring does not has support injecting capabilities for JsonSerializers. This is almost same as Validator part of Spring project. Serializers must be created by Spring and injected necessary parts to inside it.

      a sample:

      @Component
      public class PhotoSerializer extends JsonSerializer<String> {
      
         @Autowired
         TestService testService;
      
         @Override
         public void serialize(String value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
            jgen.writeString(testService.directory() + "/photo/".concat(value));
         }
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sdeleuze S├ębastien Deleuze
                Reporter:
                cemkoc Cemo Koc
                Last updater:
                Juergen Hoeller
              • Votes:
                3 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 24 weeks, 4 days ago