#519 ✓wontfix
Brad Mace

renderJSON behavior should be used when no json template is found

Reported by Brad Mace | December 30th, 2010 @ 10:44 PM

When Controller.render(Object...) is called and json format is requested and no json template is present, it should pass the argument to renderJSON(Object). If multiple arguments are given, use your magic to determine the variable names and send a json hashmap of the objects.

Or perhaps there could be an annotation such as @AutoJSON to request this behavior if it's not desired as a default behavior.

This would eliminate boilerplate code for actions that return multiple formats and don't require a custom json template.

Comments and changes to this ticket

  • Ankur Chauhan

    Ankur Chauhan January 13th, 2011 @ 11:23 PM

    Doesn't seem like an issue. I would actually want it not to go over to renderJSON(). In case i have a typo in the name or something for the template this helps in identifying it. Also, the point of the json template is to (in some cases) to formate the objects into a format that is filtering off values and possibly putting it in places where it matches the UI.

  • Nicolas Leroux

    Nicolas Leroux October 18th, 2011 @ 03:18 PM

    • State changed from “new” to “wontfix”

    I don't think we want to add to much magic as everyone as his own way of dealing with missing content.

  • Nicolas Leroux

    Nicolas Leroux October 18th, 2011 @ 03:18 PM

    • Assigned user set to “Nicolas Leroux”
  • Joshua Southern

    Joshua Southern December 6th, 2018 @ 03:50 PM

    I am learning JSON and I am definitely sure that this great information is very much helpful for me. It's a great post and people use australia writings for writing so many amazing and great things for helping others in learning. I have learned very good things about JSON here and I am quite satisfied with my learning now.

  • kota

    kota March 1st, 2019 @ 11:58 AM

    one of my client PCSO Hearing Swertres Today blog has JSON issues. He is worried because the Result of the 3 Digit game is announced and his website not able to upload it or optimize it what is the issue behind it?

  • Allenwood

    Allenwood March 18th, 2019 @ 07:07 AM

    This would eliminate boilerplate code for actions that return multiple formats and don't require a custom json template. CWAP-403 exam dumps

  • denis_richard

    denis_richard April 26th, 2019 @ 09:16 PM

    I think wikipedia has the answer to your question.

  • HarryMendez

    HarryMendez May 8th, 2019 @ 09:10 AM

    Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work! POS System

  • ahmad khan

    ahmad khan May 27th, 2019 @ 12:59 PM

    My friend is in urgent need for help. He is facing some issue and it is something about renderJSON behavior that should be utilized when no json template is found. Is there anyone who could help him here in this matter? Any kind of help would be considered a huge favor. I do find futureofwriting.net great. Kindly do share your suggestions.

  • Sharon Amendola

    Sharon Amendola May 31st, 2019 @ 09:27 AM

    wanna know more about process essay writing? There are a lot of things you may get for free!

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2>Play framework</h2>

Play makes it easier to build Web applications with Java. It is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures. Learn more on the <a href="http://www.playframework.org">http://www.playframework.org</a> website.<br><br>

<h2>Source code is hosted on github</h2>Check out our repository at <a href="http://github.com/playframework/play">http://github.com/playframework/play</a><br><br>

<h2>Contributing, creating a patch</h2> Please read the <a href="http://play.lighthouseapp.com/projects/57987/contributor-guide">contributor guide</a><br><br>

<h2>Reporting Security Vulnerabilities</h2> Since all bug reports are public, please report any security vulnerability directly to <em>guillaume dot bort at gmail dot com</em>.<br><br>

<h2>Creating a bug report</h2> Bug reports are incredibly helpful, so take time to report bugs and request features in our ticket tracker. We’re always grateful for patches to Play’s code. Indeed, bug reports with attached patches will get fixed far quickly than those without any.<br><br>

Please include as much relevant information as possible including the exact framework version you're using and a code snippet that reproduces the problem.<br><br>

Don't have too much expectations. Unless the bug is really a serious "everything is broken" thing, you're creating a ticket to start a discussion. Having a patch (or a branch on Github we can pull from) is better, but then again we'll only pull high quality branches that make sense to be in the core of Play.

Pages