We do this in our application. It's just a little different flow. We have to send a user to a different site using a post method and then they get redirected back to our site with a direct action link. We create a new WOResponse, set the content string to the html containing the post method, generate the response within the WOComponent and return that. It looks something like this...


StringBuffer html = new StringBuffer();
html.append("<html>\n");
html.append("<body BGCOLOR=#FFFFFF>\n");
html.append("<p> \"please wait while we redirect you to the test site...\" </p>\n"); html.append("<form name=\"test\" method=\"post\" action=\"https://test.psu.edu/PSU/Test \">\n");
html.append("<input type=hidden name=VALUE value=\"" + value + "\">\n");
html.append("</form>\n");
html.append("<SCRIPT LANGUAGE=\"JavaScript\">\n");
html.append("document.test.submit();");
html.append("</SCRIPT>\n");
html.append("</body>\n");
html.append("</html>");

WOResponse response = new WOResponse();
response.appendContentString(html.toString());
response = component.generateResponse();
return response;

Hope that helps,
Sherry

On Oct 7, 2009, at 12:44 AM, Tim Worman wrote:


On Oct 6, 2009, at 8:53 PM, Chuck Hill wrote:

Hi Tim,

On Oct 6, 2009, at 1:41 PM, Tim Worman wrote:

All:

I've been poking around WORedirect looking for the best way to handle this situation. Basically, I have an application which users have to fill out some information on. When they're done, they should click a button, and be directed back to another site.

So far that seems straight forward.


This button should edit EO's on my site and, if successful, send the user back to the other site

Check.


with some values sent via a POST transaction.

Here is where it gets confusing. Why a POST, why not a get? The same values as sent to your app, or different values? Does the user's browser need to do the post? Can you POST the data from your app and then just do a normal redirect?

When they are sent back to the other site I have to set a value there to indicate that they are done at my site. I send that value back in my form.



It seems like it should be easy and it seems like there's more than one way to skin this cat but I'd like to hear what others do in similar situations.

ERXRedirect can be useful for some things. Depending on what you need to do, this might give you some ideas:
http://www.jangro.com/tools/jsredirect.php

Thanks, I'll check it out.

Tim


Chuck


--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects








_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/slk24%40outreach.psu.edu

This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to