Create a controller
Before you begin: You must respect the following requirements:
-
Your class must be in a subpackage of package:
com.exalead.cv360.searchui.view.widgets.controller
. For example:com.exalead.cv360.searchui.view.widgets.controller.hello
-
There must be an
@CustomComponent
annotation. -
The Spring Controller is a class annotated with the
@Controller
annotation.
Context:
Example of an "Hello World" controller:
package com.exalead.cv360.searchui.view.widgets.controller; @CustomComponent(displayName="Hello World") @Controller public class HelloWorldController { @RequestMapping(value = "/helloWorld", method = { RequestMethod.GET }) public void helloWorld(HttpServletRequest request, HttpServletResponse response) throws Exception { response.getWriter().print("Hello World!!"); } }
This Controller can then be reached at:
http://<HOSTNAME>:<BASEPORT>/<context-name>/helloWorld