Skip to Content

Recall CMSComponentController Mapping

Can I do some Ajax call like this to reach my Controller again?

 var ComponentUrl = 'view/MyComponentController/refresh;
 
 $.ajax({
                 url: ComponentUrl,
                 type: 'POST',
                 data: postData + '&componentUid=uidOfMyComponent',
                 contentType: "application/json; charset=utf-8",
                 dataType: 'json',
                 success: function(data) {
                     ACC.update(data);
                 }
                 }
             });


I never reach my DEBUG point. (Controller self is called correctly during first rendering. But not second time with /refresh:

 @Controller("MyComponentController")
 @RequestMapping(value = ControllerConstants.Actions.Cms.MyComponent)
 public class MyComponentController
     extends AbstractAcceleratorCMSComponentController<MyComponentModel> {
 
     @RequestMapping(
         value = "/refresh",
         method = RequestMethod.POST,
         consumes = {MediaType.APPLICATION_JSON_VALUE},
         produces = MediaType.APPLICATION_JSON_VALUE)
     public final String getRecommendationsSkeleton(final Model model, @RequestParam final String jsonValue) {
         //DEBUG HERE!
         .....
         return ControllerConstants.Views.Fragments.CMS.Recommendation;
     }

How can I manage data correct as json WITH that specific parameter + '?componentUid' ?

Greatings David

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.