Firstly let me appologise for the amount of questions im asking...... Can anyone tell me how to add a parameter to a HttpServletRequest. Say for example if i wanted to add a parameter to it and then dispatch it off by forwarding it to another servlet. Do i use something like setAttribute??? What exactly does an attribute mean, is an attribute the same as a parameter etc as they are both stored in the body when using POST???
hi david, other than adding some attributes to your request object, i suggest that you also try to add some attributes to your HttpSession becasue using session to store the "shared object" between jsp and servlet is an important method too. Have fun, hope this help.
That statement is not entirely true. You are partially right because we cannot set request parameters within a jsp/servlet with a call like request.setParameter(name, value). However, when we include/forward a page in JSP we can set addtional request parameters. For eg:
Now test1.jsp can retrieve this parameter with request.getParameter("temp"). The container is responsible for passing these run time parameters to the included/forwarded page. It usually appends them as query string to the URL and includes/forwards to the specified page. Ciao, GSS