I'm facing the same problem. I did a wrapper (implementing the
HttpServletRequest interface) for the HttpServletRequest object that is
received in the servlet with the addParameter message.
In the servlet I have the following code:
public void performTask(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) {
try
{
utils.RequestWapper wrapper=new utils.RequestWapper(request);
wrapper.addParameter("fooName","fooValue");
javax.servlet.RequestDispatcher rd =
request.getRequestDispatcher("../test/page.jsp");
rd.forward(wrapper,response);
} catch (Exception e) {System.out.println(e);}
}
I'm getting the "class cast exception" in the forward message
Any clue ?
Quoting Duane Morse <[EMAIL PROTECTED]>:
> Use the RequestDispatcher and its forward() method.
>
> Duane Morse, Eldorado Computing Inc., Phoenix AZ
>
>
> -----Original Message-----
> From: Kevin Cooper [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 29, 2000 10:01 AM
> To: [EMAIL PROTECTED]
> Subject: redirect a form to another servlet
>
>
> Which is the best way to "redirect" a form submitted (my servlet adds some
> fields)by a user to another a servlet?
>
> Thanks in advance.
>
> Kevin Cooper.
> ____________________________________________________________________________
> _________
> Get more from the Web. FREE MSN Explorer download :
> http://explorer.msn.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html