how to post form to external url

UI Components for JSF
Post Reply
User avatar
wikisky
Posts: 53
Joined: 16 Jul 2010, 17:30
Location: Oakville,ON
Contact:

02 Sep 2010, 23:26

I need to post form to external url.
I can use regular html form code with form action set to external url, but I want to use skinned p:commandButton or p:button.
How to do that?
Thanks

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

03 Sep 2010, 02:32

With ajax or without ajax?

User avatar
wikisky
Posts: 53
Joined: 16 Jul 2010, 17:30
Location: Oakville,ON
Contact:

03 Sep 2010, 02:41

Without ajax, like I would do it with regular html form tag

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

03 Sep 2010, 03:12

You can set ajax to false on commandbutton.

User avatar
wikisky
Posts: 53
Joined: 16 Jul 2010, 17:30
Location: Oakville,ON
Contact:

03 Sep 2010, 05:05

I need to submit a form to external URL. In html it should look like something like:

Code: Select all

                    <form method="post" action="http://some_external_web_site.com/submit">
                        <input type="hidden" name="var_name" value="var_value"/>
                        <button type="submit">Proceed to ACS Page</button>
                    </form>
I believe I could use <p:button> instead of html <button> somehow, but not sure how.

aydoganozturk
Posts: 6
Joined: 02 Mar 2010, 13:30

03 Sep 2010, 08:48

i think you can use this

Code: Select all

<h:outputLink value="example.com" target="_new">
	<p:graphicImage value="/images/16/zoom_selection.png" title="#{lbl.go}" style="border: 0px" />
	<f:param name="param1" value="#{yourBean.obj.id}" />
	<f:param name="param2" value="#{yourBean.obj.name}" />
</h:outputLink>

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

03 Sep 2010, 10:26

If you'd like post to an external url, best practice is not to do it :)

Use h:link, h:button or p:button to do a get request with f:param tags.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 47 guests