JSF commandButton-将POST参数传递到外部站点 [英] JSF commandButton - passing POST params to an external site
本文介绍了JSF commandButton-将POST参数传递到外部站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一个链接,该链接会将我重定向到其他站点并发送POST参数.像这样:
I need a link which redirect me to a different site and send POST parameters. Something like:
<h:form>
<h:commandButton value="submit" action="http://example.com">
<f:param name="user" value="robson">
</h:commandButton>
</h:form>
上面的代码当然不起作用.
The code above doesn't work of course.
我想用HTML做到这一点:
I'd like to acheive this in HTML:
<form action="http://example.com" method="POST">
<input type="hidden" name="user" value="robson">
<input type="submit" value="submit">
</form>
有可能吗?
推荐答案
如果要将表单数据发送到非JSF目标,请使用普通HTML <form>
标记,而不要使用JSF标记.
Use the vanilla HTML <form>
tag, not the JSF tag if you're going to send form data to a non-JSF target.
JSF表单标记旨在方便 JSF回发操作,这就是为什么它没有动作"属性的原因.
The JSF form tag is designed to facilitate JSF postback operations, which is why it has no "action" attribute.
这篇关于JSF commandButton-将POST参数传递到外部站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文