does http request forwarding preserve request parameters?

Yes.

Consider 3 servlets A, B, C. Client browser submits a request to servlet A with a parameter ‘myParam’ with a value ‘myVal’. A then process the request and forwards the request to servlet B. Now B should be able to access the request parameter ‘myParam’ using request.getParameter(“myParam”). B then forwards to C. Even C should be able to find that parameter in request. So as long as you are not doing a redirect, you should be able to access request parameters in the entire forward chain.

Advertisements

One Response to does http request forwarding preserve request parameters?

  1. the kid says:

    Note that this is not true in case of redirects. The browser seems to loose the request parameters in between redirects.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: