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 8103615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:35:43+00:00 2026-06-05T23:35:43+00:00

I am building a website that would serve dynamic content. All communication between server/browser

  • 0

I am building a website that would serve dynamic content. All communication between server/browser in through REST. PostgreSQL is used as a datastore.

My question is for any GET request, should i be building the html on the fly (along with the dynamic content).

As an example

@GET
@Produces(MediaType.TEXT_HTML)
public String getAllEmployee() {
    // employees fetched from the data base
    String html = "<HTML></head> blah blah";
    return html;
}

My question is should the html be built on the fly and and sent back to the browser.
Also how does big websites like linkedin works? Do they generate the html page on the fly and send back the page?

Another method I could think of is send the barebones html with AJAX request embedded into it. And then the ajax request fetches the dynamic content from the server.

  • 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-06-05T23:35:46+00:00Added an answer on June 5, 2026 at 11:35 pm

    One of the core benefits of REST is its separation of representation (encoding) from the underlying resource being accessed.

    It’s perfectly fine to return HTML if the client requests it as a preference via the Accept header. If the client indicates that it prefers JSON or XML or whatever other super-duper encoding is dreamed up next year, then your server can return that format instead, and your URI scheme won’t change one bit.

    Most importantly, don’t forever tie your REST API to a single encoding format. Take advantage of the wonderful flexibility that HTTP content negotiation offers you as an API service provider, and that way you can give your API clients the ability to pick and choose the most appropriate format for their needs.

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

Sidebar

Related Questions

I'm building a website that will require user registration and logon. I would like
We are building a website which would serve about 30k unique visitors a day.
Building a website that has English & Japanese speaking users, with the Japanese users
I am building a website that is loaded into a frameset by other sites
I'm building a website that uses xsl stylesheets, and I'm building up a small
I am building a website that shows recommend pages for users. Users only click
I'm building a website that on its frontpage has different 'lists' of stories/articles. You
I am building a portfolio website that uses only CSS3 to display a grid
I've been building a website page that reviews other pages and with the review
In my website that I am building, when the user enters any value with

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.