Kindly please explain bold thing with an example:
Q1 ) How we can use RequestDispatcher with <c:url> tag?
Q2) How <c:import> comes into picture?
Q3) Why we need to remove session ID information?
Which of the following statements about the <c:url> core tag are true? Select three choices.
Choose at least one answer.
a. This tag can be applied to both absolute and relative URLs.
b. This tag performs URL rewriting for any kind of URLs.
c. Encoding of special characters is taken care of.
d. Specifying a URL in a foreign context is possible through the context attribute.
e. The URL created by this tag may fail when used in a RequestDispatcher call.
Choices A, D, and E are the correct answers.
<c:url> processes a URL and rewrites it if necessary. Although this tag accepts both absolute and relative URLs,
rewriting is done only for the latter. Absolute URLs are not rewritten to prevent situations where an external URL could be rewritten and
expose the session ID. Hence choice A is correct,
while choice B is incorrect.
Specifying a URL in a foreign context is possible through the context attribute. The URL specified must start with a '/' (since this is a context-relative URL). The context name must also start with a '/' (since this is a standard way to identify a context). Hence choice D is correct.
Because the URL built by this action may include session information as a path parameter, it may fail if used with RequestDispatcher of the Servlet API. The consumer of the rewritten URL should therefore remove the session ID information prior to calling RequestDispatcher. This situation is properly handled in <c:import>. Hence choice E is correct.
If the URL contains characters that should be encoded (e.g. space), it is the user's responsibility to encode them. Hence choice C is incorrect.