Announcement Announcement Module
Collapse
No announcement yet.
How to redirect another page with value object fron ajax request Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to redirect another page with value object fron ajax request

    I have a spring 3 application where i am using jquery to post ajax request. Now i want to redirect my page to another page after ajax response comes. A Pojo is returned by the 1st page controller, which is to be passed to 2nd contoller. i know how to redirect but have no idea how to pass this PoJo to next form controller

    Code:
        $.ajax({
        				    type: "POST",
        				    url: "/xxx/xxx/xxx/accept",
        				    data: "bId=" + bId+
        				    "&minDelTime=" +minDelTime,
        				    success: function(response){
        				    	if(response.errorText == null)	{
                                                        //this works fine
        					    	alert(response.orderId);
        //this is where i have to redirect with response as parameter					    	
        window.location.replace("/xxx/xxx/xxx/confirm/"+response.orderId);
    
        				    	}	else	{
        				    		alert(response.errorText);
        				    	}				    	
        				  	  },
    My next page controller -

    Code:
      @Controller
        @RequestMapping("/xxx/xxx/confirm")
        public class ConfirmationController {
        @RequestMapping(value = "{orderVo}", method = RequestMethod.GET)
        	public String showOrderConfirmPage(@PathVariable MasterVo orderVo, Model model) {
        		LOGGER.info("Entry showOrderConfirmPage()");
        		LOGGER.debug("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ : " + orderVo.toString());
        		LOGGER.info("Exit showOrderConfirmPage()");
        		return "/xxx/orderConfirmView";
        	}
        }
    But i am getting error always. Can someone please tell me how to pass object(Pojo) to new page controller?
Working...
X