jquery - Spring MVC- Change/modify Model/Session Attributes dynamically -


i'm new spring mvc , stuck following problem: have dropdown list in jsp being populated attribute(retrieved model) i've set in controller. have input box user can use add new option dropdown.

i'm using jquery ajax send value entered in input box controller handler, validating , adding model. once done, drop down list updated new value, without page being refreshed. realize can done using jquery(adding updated list select element), prefer changing attribute populating dropdown, if possible.

i tried using 'session.setattribute("mykey","listofvalues") in controller handler creates view , ${mykey} in jsp select element retrieve it, worked fine. retrieved session attribute in handler adds new value list. after updating attribute in controller, jsp drop down still displaying old list.

am doing somthing wrong? want add new items drop down on same page without redirecting/refreshing page. there anyway modify session or model attribute , see change in jsp dynamically??

thanks.

well answer has yes , no.

yes can dynamically change or add or remove values session object.

no cannot re render page once has rendered.

a jsp page rendered @ runtime , sent client machine. renderig has been done. if change session data, not reflected till page refreshed.

all can send ajax call , update dom using jquery.


Comments