A couple of questions related to the difference between forwarding and redirecting requests. I understand that the main difference is that forward is within the same request process, and redirect issues an http redirect which is a new and different request process. I've typically used redirects in the past when I needed to point a browser to another page, but I have a couple of situations where redirecting won't work, and I'm not sure if forwarding will work better or create different problems for me to solve.
That said, some specific questions about what to expect with a forward.
1) Will the same POST variables be available?
2) If forwarding from a POST (method isPost() returns true) to some new controller/action that as another if ($request->isPost()) in the code, will isPost() still return true (this is after the forward. In other words does forwarding alter the result that isPost() returns?
3) Does the client URL reflect the forward? My guess is no. (I can't test this at the moment as I am not in my development environment)
4) Does "refreshing" the client browser allow re-POSTing of the same data? One of the nice things about redirects is that it solves the irritating behavior of allowing a browser to refresh and the popup the message asking if they want to resend the same data. I'm not sure if forwarding also solves this irritating browser behavior or not.
Thanks!
Seth
没有评论:
发表评论