Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <li><a href="page2/sss">WatchEvent</a></li>
- @RequestMapping(value = "page2/{id}", method = RequestMethod.GET)
- public ModelAndView WatchEvent(@PathVariable("id")String id) {
- System.out.println("In getplayback :"+id);
- List<modelone> getdetails=Serviceone.detailsToUser(id);
- System.out.println("In getplayback from db:"+getdetails);
- return new ModelAndView("page2","getdetails",getdetails);
- }
- <script type="text/javascript">
- $(document).ready(function() {
- alert("ready");
- var fun="event";
- var savedata = {
- action:fun,
- };
- $.ajax({
- url : "events",
- type : "POST",
- datatype:"json",
- data: savedata,
- error:function(){
- alert("Error");
- },
- success: function() {
- alert("success");
- }
- });
- });
- </script> `
- @RequestMapping(value="events",method=RequestMethod.POST)
- public @ResponseBody String GetSomeEvents(){
- System.out.println("In someevent********************");
- String todayDate = new SimpleDateFormat("dd/MM/yyyy").format(new Date());
- System.out.print("today"+todayDate);
- List<modelone> getlist=Serviceone.getSomeEvents();
- return "success";
- }
- @RequestMapping(value = "events", method = RequestMethod.POST)
- public @ResponseBody String GetSomeEvents(@RequestParam String action) {
- System.out.println("In someevent********************");
- String todayDate = new SimpleDateFormat("dd/MM/yyyy").format(new Date());
- System.out.print("today" + todayDate);
- List<modelone> getlist = Serviceone.getSomeEvents();
- return "success";
- }
- $.ajaxSetup({
- scriptCharset: "utf-8",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8"
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement