I have two application.
One is PHP(http://11.11.11.11/index.php?route=catalog/common) application, and the other is Spring MVC(http://12.12.12.12/sample) application.
if PHP send post data to MVC and MVC get data successfully.
i want send data to PHP with post, not get.
I was wondering what should be implemented in any way.
This is controller.
1. return with redirect
but, data is appended URL. (http://12.12.12.12?route=catalog/com...Millis=111111&....)
2. return redirect with RedirectViewCode:@RequestMapping("test.do") public String test(@RequestParam(value = "test") String test, @RequestParam(value = "returnUrl") String returnUrl, Model model) { Map resultMap = custonService.test(test); model.addAttribute("currentTimeMillis", resultMap.get("currentTimeMillis")); model.addAttribute("currentDate", resultMap.get("currentDate")); model.addAttribute("returnInputParam", resultMap.get("returnInputParam")); return "redirect:" + returnUrl; }
but, i can't varified any data from post or get.
3. return with forwardCode:@RequestMapping("test.do") public ModelAndView test(@RequestParam(value = "test") String test, @RequestParam(value = "returnUrl") String returnUrl) { ModelAndView modelAndView = new ModelAndView(); modelAndView.getModel().put("currentTimeMillis", resultMap.get("currentTimeMillis")); modelAndView.getModel().put("currentDate", resultMap.get("currentDate")); modelAndView.getModel().put("returnInputParam", resultMap.get("returnInputParam")); RedirectView rv = new RedirectView(returnUrl); rv.setExposeModelAttributes(false); modelAndView.setView(rv); return modelAndView; }
i got 404 error with url with like this : /sample/http:/12.12.12.12/index.php
missing ?route=catalog/common.
Code:@RequestMapping("test.do") public String test(@RequestParam(value = "test") String test, @RequestParam(value = "returnUrl") String returnUrl, Model model) { Map resultMap = custonService.test(test); model.addAttribute("currentTimeMillis", resultMap.get("currentTimeMillis")); model.addAttribute("currentDate", resultMap.get("currentDate")); model.addAttribute("returnInputParam", resultMap.get("returnInputParam")); return "forward:" + returnUrl; }


Reply With Quote