Hello, I'm very noob on spring and I'm having some problems passing parameters between controllers
Here controller 1:
@RequestMapping(method = RequestMethod.POST)
public String onSubmit(@ModelAttribute("pedido") Pedido pedido, HttpServletRequest request)
throws Exception
{
String login = (String) request.getSession().getAttribute("username");
if ( WebUtils.hasSubmitParameter(request, "relatorio") )
{
request.setAttribute("pedido", pedido);
return "redirect:Relatorio.html";
}
Controller 2:
@RequestMapping(method = RequestMethod.GET)
public String showUserForm (HttpServletRequest request)
{
Pedido pedido = (Pedido)request.getAttribute("pedido");
The variable 'pedido' is always coming null when it shouldnt be. I tryied to use 'forward' instead of 'redirect' and I got this message:
type Status report
messageRequest method 'POST' not supported
descriptionThe specified HTTP method is not allowed for the requested resource (Request method 'POST' not supported).
Hope someone can help me.
ps: sorry my english


Reply With Quote

