开发者

Struts 2 redirect external URL with parameters

开发者 https://www.devze.com 2023-04-10 16:13 出处:网络
I want to make a POST HTTP request from a struts2 action to an external URL and send parameters in the request.

I want to make a POST HTTP request from a struts2 action to an external URL and send parameters in the request.

I have read that it can be done in this way: External django redirect with POST parameters but I was wondering if开发者_如何学JAVA it can be done in a different way, let's say, directly from the action and not throgh a JSP.

Thanks for any suggestions.


It depends on what you're actually trying to do.

If you're trying to make a request from your action to another site, then do something with the response and return data to the user without the user knowing the external site was accessed, then you'd need to use something like Apache's HttpClient. That can be done anywhere, bt obviously doesn't belong in a JSP as you state.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号