aspose file tools*
The moose likes JSP and the fly likes redirecting or forwarding to another website Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "redirecting or forwarding to another website" Watch "redirecting or forwarding to another website" New topic
Author

redirecting or forwarding to another website

Pinda Ros
Ranch Hand

Joined: Apr 14, 2003
Posts: 65
Hello,

I have a form on a web page and when the user clicks on the button of the form the action (part of the form) goes to page X and it passes some parameters.

The page X should forward or redirect to another website using the post method passing these parameters as well.

Ahy suggestions?

Thank you in advance.

pinda


NanoAgent is an Artificial intelligence RoBot of microscopic proportions built by means of nanotechnology
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The page X should forward or redirect to another website using the post method passing these parameters as well.
Ahy suggestions?


Pinda,
When you say another website, do you mean another context on your server, another page in your context, or literally, another site some place on another server?
[ February 10, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Rigel Kentaurus
Greenhorn

Joined: Feb 09, 2005
Posts: 11
Originally posted by Pinda Ros:
Hello,

I have a form on a web page and when the user clicks on the button of the form the action (part of the form) goes to page X and it passes some parameters.

The page X should forward or redirect to another website using the post method passing these parameters as well.

Ahy suggestions?

Thank you in advance.

pinda



With javascript, in the page X:

<form method="post" action="wherever">
<input type="hidden" name="var" value="value" />
</form>

<script>
document.forms[0].submit();
</script>
Pinda Ros
Ranch Hand

Joined: Apr 14, 2003
Posts: 65
Hello Ben I mean literrally to a different web site eg:

my site www.example.com

referenced site: www.referenced.com
Pinda Ros
Ranch Hand

Joined: Apr 14, 2003
Posts: 65
Hello Rigel,

and thank you for the reply.

I've tried your example and it does auto fw however it does not seem to pass me values...

For example my page A has a form that looks like:

and page B

when i had these hidden values to pageA it was working now it does nearly whatI want but without sending those values.

Any suggestions??

Thank you in advance
Pinda Ros
Ranch Hand

Joined: Apr 14, 2003
Posts: 65
Silly me, Thnk you for all the replies.
The solution to my problem was this java script and to my former problem was that i Forgot to add /

thank you again

Pinda
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: redirecting or forwarding to another website
 
Similar Threads
On reloading the jsp
requestdispatcher
Passing values from JSP page to Java program
how i can submit a form along with some parameters using javascript ?
mysterious parameters in forms