Announcement Announcement Module
Collapse
No announcement yet.
Redirect instead Forward Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Redirect instead Forward

    Hi

    I have a controller which perform forward action with Model

    Code:
    public class DirectSigninController  extends AbstractController {
    
    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
                throws Exception {
    
            Map model = new HashMap();
            ......
            model.put("obj",object);
                    
            return new ModelAndView("forward:home.s2",model);
    
        }    
    }
    The fact I am using forward , cause the original URL remains intact.
    which later leads to unexpected behavior if the user refresh the browser

    e.g., lets say the original URL is (this use the above controller):
    http://myServer.com/myDomain/startCall.s2


    after the forward action at the end of the controller the user actioally forward to home.s2 (as expected) page while the original URL stays in the bar,
    so if the user use F5 key to refresh the page he actially runs again the original request while he is on home.s2 page.

    Using redirect to change also the URL is impossible cause I can't send session parameters which required by the home.s2,

    One of the options I tought about was to use the redirect and build the URL parameters string for it, but it is not trivial.

    Is there any other option? what is the right way to overcome such problem?

    Thanks

  • #2
    http://forum.springframework.org/showthread.php?t=47954

    Comment

    Working...
    X