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

  • Home
  • SEARCH
  • 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 7875815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:03:50+00:00 2026-06-03T03:03:50+00:00

Basically, is it possible to do this: @Cacheable(cacheName=default) @RequestMapping(getContent/{name}) public String getContentByNameHandler(@PathVariable String name,

  • 0

Basically, is it possible to do this:

@Cacheable(cacheName="default")
@RequestMapping("getContent/{name}")
public String getContentByNameHandler(@PathVariable String name, Model model) {

    ContentService contentService = domainService.getContentService();

    model.addAttribute("model",contentService.getContentByName(name));

    return RESOURCE_FOLDER + "content";
}

When I try this, the view is cached, but the only the plain content of the jsp is returned from the cache, not the jsp view after the simple jsp view rendering logic has completed. I’m on spring 3.0.7, so still using the ehcache-spring-annotations (http://code.google.com/p/ehcache-spring-annotations)

  • 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-03T03:03:51+00:00Added an answer on June 3, 2026 at 3:03 am

    @Cacheable works by simply forming a key based on all input parameters, and putting the return value under that key.

    So it won’t store the processed view – it will simply store the view name.

    Normally, you’d use browser caching for that instead of server-side caching. And since rendering the view is supposed to be less consuming than generating the content, you’d put @Cacheable on the service method.

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

Sidebar

Related Questions

I'm not sure if this is possible or not. Basically, I'm writing a script
Basically, this question with a difference... Is it possible to capture print output from
Is this possible? Basically, I want to invoke the preprocessor as if I were
Is something like this possible? Namespace Transaction, Document Class Signer Public Sub New() 'Do
Is this possible? Here's what I'm trying: public ActionResult Index() { dynamic p =
Is this possible? Basically, what I want to do is something like this: #includeIfItExists
Is this possible? Basically, I want to give my UIView a subview, and have
Is this possible? Basically trying to test emails being sent through an SMTP server,
Is this possible to do this in one MySQL query? Basically I need to
Is this possible? Basically, what I want to do is, when I am stopped

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.