Line 2 in the above code says you are expecting the request object to have a parameter named "userId".
However, there is no such input element in your form where the name attribute is "userId". The closest you have is this:
Either you change the parameter in the first snippet to "name" or you change the input element in the JSP to have name="userId" so that things come together as you expect. Since you refer to the value as "userId" in your database, you should probably stick with "userId" instead of alternately calling the same thing two different names. That's just confusing.
BTW, your JSP is using scriptlets and you really should not be doing that in new code.
In many cases, it's best to leave old, working code be. But in this case, where the scriptlets are just if statements, converting to use <c:if> or <c:choose> is pretty straightforward (assuming that the app is properly set up to use the JSTL and EL already).
You cannot send "user" object ! You will have to send them like how you've done for userId.
This could be a little cumbersome. I see you're trying to take the values from the link and present it on the edit form, but instead you'll have to fetch the user object again from your update method (based on the userId ) and set the user object in the model for the edit JSP.
He's giving us the slip! Quick! Grab this tiny ad!
Free, earth friendly heat - from the CodeRanch trailboss