Advertisement
Guest User

Untitled

a guest
Jun 26th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. Ive introduced a new controller for OMRS module management. This currently looks like,
  2.  
  3. package org.openmrs.module.web.controller;
  4.  
  5. import java.io.IOException;
  6. import javax.servlet.http.HttpServletRequest;
  7. import javax.servlet.http.HttpServletResponse;
  8.  
  9. import org.apache.commons.logging.Log;
  10. import org.apache.commons.logging.LogFactory;
  11. import org.openmrs.module.ModuleFactory;
  12. import org.springframework.stereotype.Controller;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RequestMethod;
  15. import org.springframework.web.bind.annotation.ResponseBody;
  16.  
  17. @Controller
  18. @RequestMapping(value = "/admin/modules/manage/")
  19. public class ModuleManagementController {
  20.  
  21. protected final Log log = LogFactory.getLog(getClass());
  22.  
  23. @RequestMapping(value = "/checkdependencies", method = RequestMethod.GET)
  24. @ResponseBody
  25. public String manage(HttpServletRequest request, HttpServletResponse response) throws IOException {
  26. System.out.println("Test ! triggered by the patient search action");
  27.  
  28. return ModuleFactory.validateDependencies("moduleId");
  29. }
  30. }
  31.  
  32. my plan is to have the moduleList.jsp call this via an ajax call. So in moduleList.jsp class, I've written the following,
  33.  
  34. var oTable;
  35. var path = "${pageContext.request.contextPath}/admin/modules/manage/checkdependencies";
  36.  
  37.  
  38. function validateDependencies(id){
  39. alert(id);
  40. alert(path);
  41. $j.ajax({
  42. type : "GET",
  43. url : path,
  44. dataType : "text",
  45. success : function(data) {
  46. alert("xxxxxxxxxxxxxxxxx");
  47. }
  48. });
  49. return false;
  50. }
  51.  
  52. Unfortunately, this doesn't seem to trigger the controller at all :(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement