Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCU-563

Handle GET and POST requests using JSON objects for Controllers independent of any Page Template

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • None
    • content
    • None

      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 !

        Acceptance criteria

              tmattsson Tobias Mattsson
              g.zalys@hotmail.com Gediminas Zalys
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:

                  Task DoR