×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
Hi,

I need to redirect from a JSP page to an existing ASP page.

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.

Unfortunately, I cannot change the existing ASP page to use GET.

Would appreciate any help.

Thanks!

--
Josh

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

Dear Josh,

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:

<html>
<body onload="document.form1.submit()">
<form name="form1" action="brokenpage.asp" method="post">
<input type="hidden" name="whatever" value="<%=myjspcode%>">
... as many of those as you need
</form>
</body></html>

Hope this helps
-pete

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

(OP)
Hi Pete,

First, thanks for your reply.

I cannot construct a querystring and then redirect, ie

http://myasp?a=b&c=d

because the ASP expects a POST.  The above will work if the ASP expects parameters through a GET.  Again I cannot change the ASP because it does not belong to me and it is unfortunately not an option.  I believe the ASP is using something like  request.form("a") instead of QueryString("a") or just request("a")

Your second solution looks very interesting.  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?  If so, that is pretty cool!  Hopefully javascript is supported on all popular browsers other than IE and Netscape.  Do you happen to know if AOL's browser supports JavaScript?

What is the user's experience like?  

Thanks again.

--
Josh

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

Dear Josh,

> javascript automatically submits back to the server without having the user do anything?  

Yes

> Do you happen to know if AOL's browser supports JavaScript?

No I don't, sorry. Try looking at the Website Garage for information about many browsers and their capabilities:
http://websitegarage.netscape.com/


> What is the user's experience like?  

Well there should be a flicker when the screen blanks. You could place some message there like "Loading please wait..." 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.

Since you can't fix the ASP page you don't have much choice.

Hope this helps
-pete

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close