Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. <li><a href="page2/sss">WatchEvent</a></li>
  2.  
  3. @RequestMapping(value = "page2/{id}", method = RequestMethod.GET)
  4. public ModelAndView WatchEvent(@PathVariable("id")String id) {
  5. System.out.println("In getplayback :"+id);
  6. List<modelone> getdetails=Serviceone.detailsToUser(id);
  7. System.out.println("In getplayback from db:"+getdetails);
  8.  
  9. return new ModelAndView("page2","getdetails",getdetails);
  10. }
  11.  
  12. <script type="text/javascript">
  13. $(document).ready(function() {
  14. alert("ready");
  15. var fun="event";
  16.  
  17. var savedata = {
  18. action:fun,
  19. };
  20. $.ajax({
  21. url : "events",
  22. type : "POST",
  23. datatype:"json",
  24. data: savedata,
  25. error:function(){
  26. alert("Error");
  27. },
  28. success: function() {
  29. alert("success");
  30.  
  31. }
  32. });
  33. });
  34. </script> `
  35.  
  36. @RequestMapping(value="events",method=RequestMethod.POST)
  37. public @ResponseBody String GetSomeEvents(){
  38. System.out.println("In someevent********************");
  39. String todayDate = new SimpleDateFormat("dd/MM/yyyy").format(new Date());
  40. System.out.print("today"+todayDate);
  41. List<modelone> getlist=Serviceone.getSomeEvents();
  42.  
  43. return "success";
  44. }
  45.  
  46. @RequestMapping(value = "events", method = RequestMethod.POST)
  47. public @ResponseBody String GetSomeEvents(@RequestParam String action) {
  48. System.out.println("In someevent********************");
  49. String todayDate = new SimpleDateFormat("dd/MM/yyyy").format(new Date());
  50. System.out.print("today" + todayDate);
  51. List<modelone> getlist = Serviceone.getSomeEvents();
  52.  
  53. return "success";
  54. }
  55.  
  56. $.ajaxSetup({
  57. scriptCharset: "utf-8",
  58. contentType: "application/x-www-form-urlencoded; charset=UTF-8"
  59. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement