File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes RequestDispatcher Parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "RequestDispatcher Parameters" Watch "RequestDispatcher Parameters" New topic

RequestDispatcher Parameters

Andy Smith
Ranch Hand

Joined: Sep 28, 2003
Posts: 239
Supposes i m passing a query string to a RequestDispatcher....
and the request object contains a parameter with the same name as a parameter in query String..
So which parameter (Query String/Request) would be overwritten by the other..?

RequestDispatcher rd = context.getRequestDispatcher("/abc.jsp?myparam=aaa");
rd.include(request, response);
the myparam Parameter is also paramter in request

Share Knowledge to gain it.
SCJP 2, SCWCD 2, SCDJWS, IBM 141 (In Progress), IBM 486 (Next)
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
No it will append the parameter values to the array of String... The first index of the parameter will be "aaa", and the second and so on will be parameter values from the request... You can use getParameterValues method of the request... But if you use getParameter method, the string on the first index will be returned...

Hope you are clear...

Co-author of SCMAD Exam Guide, Author of JMADPlus
Andy Smith
Ranch Hand

Joined: Sep 28, 2003
Posts: 239
So what will be in the first index of array ..the POST attribute or the GET...
as we should know which attributs are stored first in the array GET or POST...
Thanx Naing
I agree. Here's the link:
subject: RequestDispatcher Parameters
It's not a secret anymore!