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
Post a Comment