I want to call some methods in my jsp file. I have a class file with some methods and I want to use some of the methods used in that class file. I have gone through page import in JSP, but still I didn't get any idea about how to do that. I have installed some extra libraries and which is required to run those methods. Do I need to place the libraries in the server where I am using the jsp file. Can anyone suggest me how to do that..
Asked
Active
Viewed 746 times
2 Answers
4
- add the jars in
WEB-INF/lib
- Avoid using java code in JSP, use EL and/or
jsp:useBean
isntead.
-
Where can I found the folder in windows. I have installed tomcat in "D:\tomcat". – Dijo David May 13 '11 at 10:04
-
did you read a tutorial before starting? The path is `tomcat/webapps/yourwebapp/WEB-INF/lib` – Bozho May 13 '11 at 10:04
-
Can you please share some good tutorial link for using the java methods in JSP file – Dijo David May 13 '11 at 10:11
-
I gave you a link to a tutorial showing how not to use java methods in jsp. The tutorial that you should start with is perhaps the official jsp and servlet tutorial. – Bozho May 13 '11 at 10:12
-
+1: For pointing at the only right direction, despite doing it a bit forcibly. – Rekin May 13 '11 at 10:46
1
Use @page Directive tag to include the java class file and create object in scriptlet(<% %>) tag and use the methods of that class as you want..

Loga
- 658
- 1
- 7
- 17