You have incorrectly mapped the form to the user
action. The user
action is mapped to the default namespace but the form is mapped to /modelDriven
namespace. So, when you submit the form you should get 404 error. Remove the namespace
attribute from the form tag which should be a struts tag. If you don't set the namespace attribute of the form tag the action might use the default namespace. More about namespaces and its configuration you could find here. The code to replace
<s:form accept-charset="UTF-8" action="user" method="POST" theme="simple">
Note, added simple
theme for the form to not affect the HTML design. Also, if you are running in developer mode the warnings should disappear if the action in the struts form tag is mapped correctly.
Also note, that strings in Java are compared with the equals
method, not ==
. So, the crudType
variable might not change and it prevents the update operation.