Why does Wicket change the action attribute of a form tag without a gate?

In the basic template for the pages of my Wicket application, there is a form that I do not want to use Wicket, for example:

<form id="myForm" action=""> <!-- input fields and submit button --> </form> 

I left the action attribute empty to always send it to the current page. On the main page of the application, this works, but on other pages, Wicket adds "../" to the action attribute, which seems to make sense, but this is not what I want.

I am using Wicket 1.4.17. How can I stop or change this behavior?

The form is designed so that the user can send a short message as feedback to the site administrator. It appears on every page, and input is collected from PageParameters in the constructor of the base class of my pages. If there is a more carriage-friendly way to do this, I will appreciate the tips, but this should be a) stateless and b) very simple.

+4
source share
1 answer

I would go by the gate and write a component for your feedback form, which is then inserted into each page. Since you have a (abstract) base class for all of your pages, you can simply add it there and it will appear on every page.

In the component of the feedback form, simply overwrite the onSubmit () method and send a message to the site administrator.

+1
source

Source: https://habr.com/ru/post/1388626/


All Articles