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

setPrefixJson don't work in org.springframework.web.servlet.view.json.MappingJackson2JsonView and org.springframework.web.servlet.view.json.MappingJacksonJsonView

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.2.3
    • Fix Version/s: 3.2.4, 4.0 M2
    • Component/s: Web
    • Labels:
    • Last commented by a User:
      true

      Description

      public void setPrefixJson(boolean prefixJson) {
      this.jsonPrefix = "{} && ";
      }
      suggestion, replace by this : this.jsonPrefix=(prefixJson)?"{} && ":"";

      quick workaround :

      just add <property name="jsonPrefix" value="" />
      and remove <property name="prefixJson" value="false" />

      if you don't remove prefixJson, maybe it will set jsonPrefix value...

      you can also just remove and set the string but it's more safe to know that is the value

        Attachments

          Activity

            People

            • Assignee:
              rstoya05-aop Rossen Stoyanchev
              Reporter:
              meekado Meekado
              Last updater:
              Spring Issuemaster
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                35 weeks, 1 day ago