Redirect to an Outside application along with the hidden values

Our application uses Struts and JSF , (started using struts this week) ..I am to redirect the user to an outside application (different server anb application) with some of the hidden values ...

I was wondering what should I use in my ActionClass execute method ...

public class SendToGoAction extends Action {

public ActionForward execute(ActionMapping mapping,

ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

####################################

#########################################

}

}

Thanks for your time

[622 byte] By [micro_learnera] at [2007-10-2 16:46:54]
# 1

// redirect to the outside application

response.sendRedirect( "http://theTargetUrl?param1=" + param1Value);

// return null from the action to indicate you have handled the response.

return null;

evnafetsa at 2007-7-13 17:57:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Last question ..if I were to send them as Hidden Values rathen the param how would I do this ..as the Param List is huge list of string (some 500+ strings) and would ideally be sent as a hidden value as the URL in the target application would be clutteredThanls for your time
micro_learnera at 2007-7-13 17:57:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Ok. I see where you're coming from now.

The http redirect does not support POST - it only supports GET.

So if you use a redirect, you have to send all your parameters in the request string. With 500 parameters, that can be messy, and also might not work, as there is a limit on the url.

Alternative

- produce an HTML page, with a form, and all the values required in the hidden fields. Have a javascript onload event that submits the form to the required application.

Its kind of doing a manual redirect, but it lets you do a post, rather than get.

Another alternative would be to use java.net classes to open a connection to that remote server, and pass along the parameters. You would do that from java code. But that would still look like it was coming from your application, so it might not be applicable.

is that 500 parameters you are passing between web apps?

WHY?

evnafetsa at 2007-7-13 17:57:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Actually it is one paramer only but as a string seperated by "#"par1#par2#par3
micro_learnera at 2007-7-13 17:57:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
I am sorry if I am asking for too much ...>>Have a javascript onload event that submits the formCould u gimme a sample which dies this Thanks
micro_learnera at 2007-7-13 17:57:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

<html>

<body onload="document.forms[0].submit()">

<form name="redirectForm" action="http://some.url.com" method="post">

<input type="hidden" value="<%= paramValue %>">

</form>

</html>

evnafetsa at 2007-7-13 17:57:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
Thanks man I appreciate your help .
micro_learnera at 2007-7-13 17:57:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...