hope the below code helps.

protected void doRedirect(
                javax.servlet.http.HttpServletResponse response,
                String token)
                throws javax.servlet.ServletException, java.io.IOException {

                        response.getWriter().write(
                                "<html> <body onload='document.f.submit();'> " +
                                "Please click <a href='" + alertsURL + "'> here </a> 
if you are not automatically redirected to the Alerts section" +
                                "<form name='f' action='" + alertsURL + "' 
method='post'>" +
                                "<input type='hidden' name='token' value='" + token + 
"'>" +
                                "</form></body></html>");
                }

--
hiren

>
> From: Gayathri Palicherla <[EMAIL PROTECTED]>
> Date: 2002/09/09 Mon AM 11:22:22 EST
> To: [EMAIL PROTECTED]
> Subject: Re: Automatic form post using Servlet or Java code
>
> Geeta,
>
>     I mean to do http-post from Servlet code to html page in other words form submit 
>from Servlet code to html page using http-post, not about handling post requests 
>using doPost.
>
> not sure whether RequestDispatcher does http-post or not, and also not stated in Api 
>document.
>
> Thank you,
> Gayathri.
>
>
> >I'm not too sure if I understand your question correclty.. When a form is >posted, 
>the doPost of the corresponding servlet is called and
> >executed. So are you saying that's what you want to do from within the >same or 
>another servlet? If it's within the same servlet, all
> >you have to do is simply call doPost. If it's from another servlet, use >the 
>RequestDispatcher instead.. (check the archives for sample
> >code).
>
> >Regards,
> >Geeta
>
> Gayathri Palicherla wrote:
>
> > Folks,
> >
> >  I'm trying to do Automatic Form Post in the Servlet code, is it possible to do, 
>Please give me suggestions on how to achieve this.
> >
> > I appreciate your help,
> > Gayathri.
> >
>
> ___________________________________________________________________________
> 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

Reply via email to