Here is the question:
Consider doGet() of a valid servlet with url pattern /source,
and doGet() of another valid servlet with url pattern /target.
What is the output when invoking http://localhost:9999/exam/source?user=nikos&pass=12345? (1 correct answer)
I have never seen "javax.servlet.forward.query_string", and couldn't locate it in online API. Anyone know where I should look to see it's decription?
Sure - just take a look at the spec: http://jcp.org/aboutJava/communityprocess/final/jsr315/index.html
Section 9.4.2, pp. 92 - 93.
9.4.2 Forwarded Request Parameters
Except for servlets obtained by using the getNamedDispatcher method, a servlet that has been invoked by another servlet using the forward method of RequestDispatcher has access to the path of the original request.
The following request attributes must be set:
The values of these attributes must be equal to the return values of the HttpServletRequest methods getRequestURI, getContextPath, getServletPath, getPathInfo, getQueryString respectively, invoked on the request object passed to the first servlet object in the call chain that received the request from the client. These attributes are accessible from the forwarded servlet via the getAttribute method on the request object. Note that these attributes must always reflect the information in the original request even under the situation that multiple forwards and subsequent includes are called.
If the forwarded servlet was obtained by using the getNamedDispatcher method, these attributes must not be set.