You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thorsten Schöning <ts...@am-soft.de> on 2020/03/18 09:19:22 UTC

How to change the target of some form-action to some configured value?

Hi all,

I'm rendering a web page for offline use, but am playing around with
integration into the parent web site where that offline page comes
from. The current approach is to simply show the same auth-form used
by the online variant itself already and to simply POST credentials
there.

The problem is that Wicket generates a local action-target for the
form and I don't see any way to override that behaviour. Look at the
following examples:

> <form action="./wicket/page?[...]" method="post"[...]

vs.

> <form action="https:/example.org/some_app/wicket/page?[...]" method="post"[...]

What I'm currently doing is implementing a custom
"AbstractTransformerBehavior" simply changing the action-attribute in
the generated markup using some configured value.

Is that the easiest/preferred approach?

Searchign for that topic I only found Ajax-related things, which is
not what I'm interested in. But I couldn't find somethign to simply
set the target or override the strategy how that is calculated or
such.

Thanks for your hints!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to change the target of some form-action to some configured value?

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Sven Meier,
am Mittwoch, 18. März 2020 um 10:41 schrieben Sie:

> have you tried overriding #getActionUrl()?

No, that was exactly what I was looking for and must have missed.
Thanks, it works as expected.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to change the target of some form-action to some configured value?

Posted by Sven Meier <sv...@meiers.net>.
Hi Thorsten,

have you tried overriding #getActionUrl()?

Sven


On 18.03.20 10:19, Thorsten Schöning wrote:
> Hi all,
>
> I'm rendering a web page for offline use, but am playing around with
> integration into the parent web site where that offline page comes
> from. The current approach is to simply show the same auth-form used
> by the online variant itself already and to simply POST credentials
> there.
>
> The problem is that Wicket generates a local action-target for the
> form and I don't see any way to override that behaviour. Look at the
> following examples:
>
>> <form action="./wicket/page?[...]" method="post"[...]
> vs.
>
>> <form action="https:/example.org/some_app/wicket/page?[...]" method="post"[...]
> What I'm currently doing is implementing a custom
> "AbstractTransformerBehavior" simply changing the action-attribute in
> the generated markup using some configured value.
>
> Is that the easiest/preferred approach?
>
> Searchign for that topic I only found Ajax-related things, which is
> not what I'm interested in. But I couldn't find somethign to simply
> set the target or override the strategy how that is calculated or
> such.
>
> Thanks for your hints!
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org