[DOCU-563] Handle GET and POST requests using JSON objects for Controllers independent of any Page Template Created: 19/May/15  Updated: 03/Nov/15

Status: Closed
Project: Documentation
Component/s: content
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Neutral
Reporter: Gediminas Zalys Assignee: Tobias Mattsson
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:

 Description   

I have been playing around with Blossom Module .

I love the fact that you can create page templates using annotations, and provide page specific services within the controller you are working on. However the challenge i am facing is that my web services that I want to create need to be available for any page. (they have to be externally available and accessible via URL)

So i have tried the standard way of creating a controller:

 
@Controller
@RequestMapping("/xyzPage")
public class XyzPageController {

       @RequestMapping(method = RequestMethod.GET)        
       public String render() {
             return "pages/xyzPage.jsp";
      }
}

but for some reason this controller never gets invoked using URL like below :

http://localhost:8080/myProject-webapp/xyzPage

It only works when i add Blossom annotation such as @Template

Just to give you some background, i am using configurations in the sample blossom project

Im sensing that BlossomServletConfiguration has got something todo with this, but i am not familiar enough with the setup to apply my own changes ....

So to summarise, what i am trying todo is make publicly available web services that would return or consume JSON files.
What is the best practise for this?
I have seen a number of conversations on the web but nothing really answers this
Any help provided will be highly appreciated !



 Comments   
Comment by Tobias Mattsson [ 22/May/15 ]

Hi Gediminas,

I have added a section on this in the documentation here:
https://documentation.magnolia-cms.com/display/DOCS/Blossom+module#Blossommodule-AdditionalDispatcherServletsandAJAXcalls

It was previously on the wiki but should now be easier to find. There are other topics covered there that might come in handy:
https://wiki.magnolia-cms.com/display/WIKI/Magnolia+Blossom

Generated at Mon Feb 12 01:10:17 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.