java - Modify a form in Spring MVC -



java - Modify a form in Spring MVC -

application : spring, jsp

is possible create editable form in spring mvc + jsp? can create new form using

<sf:form modelattribute="employee method="post>

but 1 time inputs saved in database, how form provided user allow them modify inputted values?

sorry, don't have thought how can done, have not posted have tried!

thanks in advance

i assume adding sort of empty employee entity or form object model when render form. example:

model.addattribute("employee", new employee());

if want edit employee record after save it, add together employee instance model instead of empty instance. example:

employee employee = employeeservice.getemployeebyid(employeeid); model.addattribute("employee", employee);

you need create separate controller method has id of employee want edit in path variable or request param know employee instance retrieve , add together model (the illustration above assumes have service that).

hope helps, if need clarification, leave comment , i'll seek update answer.

java spring jsp spring-mvc

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -