Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5993193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:38:24+00:00 2026-05-22T23:38:24+00:00

Currently when I (or more importantly, a user) type in one of my rest

  • 0

Currently when I (or more importantly, a user) type in one of my rest functions into the URL, it works, with the 200 status code. But if you type a wrong one or mispell it, a 404 page is generated, with a 404 status code when looking at it through a REST client.

Instead of getting a 404 page when the bad URL is sent, I would instead like to display a dynamically generated JSON object.

How do I fix that error handling to do what I want, Is there a place where I can define what should be done during a particular status code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:38:24+00:00Added an answer on May 22, 2026 at 11:38 pm

    I am not very familiar with the Play Framework, but I was interested. This discussion seemed at least similar to what you want:

    Gaëtan Renaudeau

    …

    You can customize errors pages
    depending of the http code error (404,
    500, 403, …) by editing
    app/views/errors/{code}.html files
    where {code} is you http code. If
    you are using other format than html
    (like xml, json) you can have
    404.json , 404.xml, etc…

    So, modify:

    app/views/errors/404.type_of_response
    

    Hopefully this at least points you in the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page where there is currently more than one form. I used
Currently working with converting SQLException error messages into messages that are more useful for
There Currently is a local debate as to which code is more readability We
I'm currently trying to get into Java Web Development in general in Spring more
I'm asking for help so my life, and more importantly my user's lives will
currently im writing a test for a report function the more functionality the project
I'm currently trying to build a more or less complete set of unit tests
I'm currently learning a bit more about Linq-To-Entities - particularly at the moment about
i'm currently wondering how to add more localizations to my PhoneGap App on the
Currently making a global volunteer site, and the webpages will more or less have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.