Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ive introduced a new controller for OMRS module management. This currently looks like,
- package org.openmrs.module.web.controller;
- import java.io.IOException;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import org.apache.commons.logging.Log;
- import org.apache.commons.logging.LogFactory;
- import org.openmrs.module.ModuleFactory;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.ResponseBody;
- @Controller
- @RequestMapping(value = "/admin/modules/manage/")
- public class ModuleManagementController {
- protected final Log log = LogFactory.getLog(getClass());
- @RequestMapping(value = "/checkdependencies", method = RequestMethod.GET)
- @ResponseBody
- public String manage(HttpServletRequest request, HttpServletResponse response) throws IOException {
- System.out.println("Test ! triggered by the patient search action");
- return ModuleFactory.validateDependencies("moduleId");
- }
- }
- my plan is to have the moduleList.jsp call this via an ajax call. So in moduleList.jsp class, I've written the following,
- var oTable;
- var path = "${pageContext.request.contextPath}/admin/modules/manage/checkdependencies";
- function validateDependencies(id){
- alert(id);
- alert(path);
- $j.ajax({
- type : "GET",
- url : path,
- dataType : "text",
- success : function(data) {
- alert("xxxxxxxxxxxxxxxxx");
- }
- });
- return false;
- }
- Unfortunately, this doesn't seem to trigger the controller at all :(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement