Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I redirect extra parameters from JSP to ASP via POST?

Status
Not open for further replies.

joshlam

Programmer
Jul 19, 2000
4
US
Hi,<br><br>I need to redirect from a JSP page to an existing ASP page.<br><br>I realized that I can use sendRedirect(), however, I also need to send some new parameters (along with those I received through an earlier POST to my JSP page) to the ASP page. I am required to use POST because the ASP page is *expecting* a POST.<br><br>Unfortunately, I cannot change the existing ASP page to use GET. <br><br>Would appreciate any help.<br><br>Thanks!<br><br>--<br>Josh<br>
 
Dear Josh,<br><br>Assuming that you have actually tried using sendRedirect with a querystring and the target ASP page does not work correctly (It really should), then you could do this. Have your JSP page send a page like this back to the browser:<br><br>&lt;html&gt;<br>&lt;body onload=&quot;document.form1.submit()&quot;&gt;<br>&lt;form name=&quot;form1&quot; action=&quot;brokenpage.asp&quot; method=&quot;post&quot;&gt;<br>&lt;input type=&quot;hidden&quot; name=&quot;whatever&quot; value=&quot;&lt;%=myjspcode%&gt;&quot;&gt;<br>... as many of those as you need<br>&lt;/form&gt;<br>&lt;/body&gt;&lt;/html&gt;<br><br>Hope this helps<br>-pete
 
Hi Pete,<br><br>First, thanks for your reply.<br><br>I cannot construct a querystring and then redirect, ie<br><br><A HREF=" TARGET="_new"> the ASP expects a POST.&nbsp;&nbsp;The above will work if the ASP expects parameters through a GET.&nbsp;&nbsp;Again I cannot change the ASP because it does not belong to me and it is unfortunately not an option.&nbsp;&nbsp;I believe the ASP is using something like&nbsp;&nbsp;request.form(&quot;a&quot;) instead of QueryString(&quot;a&quot;) or just request(&quot;a&quot;)<br><br>Your second solution looks very interesting.&nbsp;&nbsp;So does it mean that once the form is sent back to the browser, ,javascript automatically submits back to the server without having the user do anything?&nbsp;&nbsp;If so, that is pretty cool!&nbsp;&nbsp;Hopefully javascript is supported on all popular browsers other than IE and Netscape.&nbsp;&nbsp;Do you happen to know if AOL's browser supports JavaScript?<br><br>What is the user's experience like?&nbsp;&nbsp;<br><br>Thanks again.<br><br>--<br>Josh
 
Dear Josh,<br><br>&gt; javascript automatically submits back to the server without having the user do anything?&nbsp;&nbsp;<br><br>Yes<br><br>&gt; Do you happen to know if AOL's browser supports JavaScript?<br><br>No I don't, sorry. Try looking at the Website Garage for information about many browsers and their capabilities:<br><A HREF=" TARGET="_new"> What is the user's experience like?&nbsp;&nbsp;<br><br>Well there should be a flicker when the screen blanks. You could place some message there like &quot;Loading please wait...&quot; then use a timer to slow down the submit() so they can see the message. This is all effected by the speed of the users connection and the responsiveness of your .ASP target page.<br><br>Since you can't fix the ASP page you don't have much choice.<br><br>Hope this helps<br>-pete<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top