Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i get the controller name in jsp?

I am developing a very small web application with spring mvc, In my jsp view that is returned by controller,I want to get the name of the controller.

One way is we can pass the name in ModelandView,But I don wan to do that. As I am sending a list of some other oblect.

I am looking for other best solution if any.

With Advance thanks, Laxmi

like image 756
laxmi Avatar asked Nov 13 '22 21:11

laxmi


1 Answers

Here are some ways that came through my mind:

  1. Pass it in the request using request.setAttribute("name", "controller name");. Then in your jsp you can call ${ param.name }.

  2. Pass it in the session using session.setAttribute("name", "controller name");. Then in your jsp you can call ${ name }.

like image 102
Russell Gutierrez Avatar answered Dec 05 '22 22:12

Russell Gutierrez