2

I have a apache wicket form where the contents of the form should be sent to other external website. Is that possible in wicket, If possible, please post some code. I tried with new RedirectPage(url); . But, its sending a GET request instead of POST.

speruri
  • 73
  • 2
  • 10

2 Answers2

2

Override getActionUrl() on your wicket form to return the url you need to submit to.

WhoopP
  • 141
  • 7
1

Java code:

Form<?> form = new Form<Void>("myform") {
    private static final long serialVersionUID = 1L;

    @Override
    protected String getActionUrl() {
        return "https://www.stackoverflow.com";
    }
}

add(form);

Html code:

<form wicket:id="myform">
    <input type="submit"/>
</form>
Daniel Huang
  • 113
  • 1
  • 7