Results 1 to 3 of 3

Thread: Status 404 error on redirect

  1. #1
    Join Date
    Feb 2012
    Posts
    1

    Default Status 404 error on redirect

    Hi,

    I have this error, I have a form, and on submission i display a successView but for some reason is shows and 404 error.
    below is the code snippet.
    Code:
    @Controller
    @RequestMapping("registerForm")
    public class Contoller {
    
    @RequestMapping(method = RequestMethod.GET)
        public String setupForm() {
           ....
            return "registerForm";
        }
    
    @RequestMapping(method = RequestMethod.POST)
        public String submitForm() {  
            ...     
            return "redirect:registerSuccess";
        }
    
    }
    and the error log says No mapping found on registerSuccess.

    How do I map the registerSuccess?

    Thanks in advanace

  2. #2
    Join Date
    Jul 2012
    Posts
    9

    Default

    I tried solving the question but failed. Hope for a better helping hand.

  3. #3
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    A redirect has to be a URL not a view. A redirect is client side (status 301/302) and as such should be a complete URL.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •