In a view, how would I access the name of controller and method that returned the view? This is rather straight forward in Grails, but I'm stumped on how to go about it in plain Spring.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
JSP (You are using a JSP view right?) doesn't have a ${controllerName}
expression like in Grails. But you can pass the name of the controller and the method via model.
回答2:
just do in controller method
String className = this.getClass().getName();
and add classname to model.