java - Display message in a toastr from controller in Spring -



java - Display message in a toastr from controller in Spring -

i using toast display success message on jsp page , inquire if there way display username set in session in controller in toast along success message. toast :-

toastr.success('successfully', 'registered',{timeout:2000});

my controller has next line of code set username:- session.setattribute("username",username);

where username has fullname attribute.

first should set message model or modelandview, such

model.put("message","ok");

then can utilize $ display message value in jsp.

toastr.success('${message}', 'registered',{timeout:2000});

java jquery spring jsp

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -