在视图中获取Spring控制器和方法的名称 [英] Get name of Spring controller and method in view

查看:51
本文介绍了在视图中获取Spring控制器和方法的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在视图中,如何访问返回该视图的控制器和方法的名称?在Grails中,这很简单,但是我对如何在纯Spring中实现它感到困惑.

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.

推荐答案

JSP(您正在使用JSP视图吗?)没有像Grails中那样的${controllerName}表达式.但是您可以通过模型传递控制器的名称和方法.

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.

这篇关于在视图中获取Spring控制器和方法的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆