Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

struts reset() is not called before populating the form

Tags:

struts

I got a strange (and probably) wrong behaviour here. I was trying to put a checkbox on the page, and you know it: unchecked checkboxes are not written to the request (only checked boxes are)

What struts normally offers is to override:

@Override
public void reset(ActionMapping mapping, ServletRequest request)

to reset all the checkboxes to "false". But in my case, this reset() is never called!

Someone got an idea?

Thanks in advance,

mana

like image 731
mana Avatar asked Oct 20 '25 04:10

mana


1 Answers

The correct method signature to override is

public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request)

like image 66
Azam Abdul Rahim Avatar answered Oct 24 '25 19:10

Azam Abdul Rahim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!