The Artima Developer Community
Sponsored Link

Java Answers Forum
submit form on another site and take my users to external confirmation page

1 reply on 1 page. Most recent reply: Aug 23, 2003 8:19 AM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Stephen Huey

Posts: 10
Nickname: stephen
Registered: Aug, 2003

submit form on another site and take my users to external confirmation page Posted: Aug 20, 2003 3:33 PM
Reply to this message Reply
Advertisement
I'm modifying a JSP/servlet site that I didn't develop, so I'm kind of new to this. I'm trying to pull contact info from a bean on my site, and I can do that just fine. I need to use it to submit a form on another website's webpage (done in ASP, but I don't think that matters). I wanted to populate the text fields on that external form, but I don't think that's possible, b/c in the source those fields' values are hardcoded like this:

value=""

If you know of any way to trick it, I'm all ears. Meanwhile, my preference was to populate the fields and not submit it so that users could view the info before submitting, but that's not necessary, b/c the next page is a confirmation page (so I'm assuming I can post the form data from within my Java code and so just take my users straight to that external confirmation page).

For another project, I used the Apache Common HTTPClient, but in this case, I'd rather not, b/c I don't yet even know how to compile all the site (I only know how to make changes to the JSPs). I figure it should also be pretty easy to submit a form in JSP, even if it's on another site. Am I right? I'm not sure how to, though--it seems a little bit hairy, especially the part where I need to open up that confirmation page after submitting the form. Do I just use GET or POST to submit a form and have the HREF include target='_blank', or is it a bit trickier than that? If you have a good idea about how to code this, I'd love to see it!

Thanks,
Stephen


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: submit form on another site and take my users to external confirmation page Posted: Aug 23, 2003 8:19 AM
Reply to this message Reply
Use the pageContext.forward in your jsp as in the following example.


pageContext.forward("confirmation.jsp?name=tom&email=tom@yahoo.c om&age=23&zip=39180");

Where the inputs the confirmation page needs are separated with the ampersand:

name=tom
email=tom@yahoo.com
age=23&zip=39180

Flat View: This topic has 1 reply on 1 page
Topic: Priority Queue  linked list Previous Topic   Next Topic Topic: Creating variables on the stack

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use