java - can i set the url before returning the ModelAndView? -


is possible set url before returning model?

for example, current url http://localhost/home.html @ homecontroller, return modelandview page, example

modelandview model = new modelandview("contact"); model.addobject("contactno", "12345"); return model; 

then after returning model, contact.jsp has been loaded browser it's url still http://localhost/home.html, want change http://localhost/contact.html, how can able that?

thanks

try instantiating modelandview this,

modelandview model = new modelandview(new redirectview("contact")); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -