Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling bean method in JSP without using scriptlets

Tags:

jsp

jstl

How can I call a bean method in JSP without using scriplets such as <% myBean.method() %>?

I have created my application in JSP. I know it is possible using JSF, but I don't want to create a new project.

Is it possible to use JSP or JSTL to solve this problem and call a bean method?


1 Answers

You can call a bean method using EL. Just pass a reference of the class that has the method to JSP and call it like this: ${objectName.methodName()}

like image 56
Ajinkya Avatar answered Oct 22 '25 05:10

Ajinkya