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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:26:31+00:00 2026-05-23T17:26:31+00:00

I have a Spring 3.0 web application which tries to follow the REST principles

  • 0

I have a Spring 3.0 web application which tries to follow the REST principles as long as it is pragmatic.

I have a controller method to return a folder (this are my Business Entities). (GET http://…/folders/{id}). If a user accesses this URL he gets a complete HTML page: with header, footer, menu, and the folder details. – The “enhancing” with header, footer and menu is done with Apache Tiles.

Now I have another view where the user see the folder tree, and if he clicks on one of the folders, the folder details will/should be loaded via AJAX, and displayed next to the tree. In this case the AJAX Response should be the rendered HTML (no JSON), because the real content should look like when the user access the folder page directly.

My problem is, when I request the same URL, then the server will return not only the real content, but also the header, footer and menu.

My question is how can I handle this in a stylish way: – Of course I can use an additional parameter and two controller methods with different tile templates, but I think is not nice, because it uses html parameter for “layout” and I have to write two controller methods (and all the stuff around) only to have two tile templates

  • So what is a recommended way to access the same “content” with another HTML “layout” in a rest way?
  • Is there any way to switch the template in the tiles template definition, depending on what I need (how that is specified depends on the answer to the other question).
  • 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-23T17:26:31+00:00Added an answer on May 23, 2026 at 5:26 pm

    In ReST, problems like the one you’re describing would be solved by content negotiation based on an Accept header: the requester would indicate the expected type such as test/html, application/json, etc. You could possibly make use of this by having your Ajax call request a different type. Since you’re using Spring 3 MVC, you should be able to configure your ViewResolvers to return decorated or undecorated views based on the requested type. This looks like a reasonable example.

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

Sidebar

Related Questions

I have a web application using JPA and JTA with Spring. I would like
I am using Spring MVC to build my web application, and I have a
We have a (non-web app) Spring application that throws a NoSuchBeanDefinitionException when running tests
I have an ASP.NET web application project which references another project called ModusCore (or
I have a Spring Web MVC application that I'd like to serve a large,
I have a Web application using spring and hibernate and struts (it runs on
My colleague and I have a web application that uses Spring 3.0.0 and JPA
I am currently working on securing a web application using spring-security 3.0. I have
I'm developing a Grails (Version 1.3.3) Web-Application using the Grails Spring-Security Plugin, Spring-Security-Core-1.0.1 (which,
I have a web application in Spring that has a functional requirement for generating

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.