Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call a method fro several JSP scripts

Status
Not open for further replies.

wwworg

Programmer
Feb 10, 2006
35
0
0
CA
Hey guys

I have like 5 .JSP scripts. I have declared a method in one of these 5 scripts, but I need to be able to call this method from all 5 .jsp scripts??? How can i do that.

Thanks

 
1) Write an include file with the *global* function in it, and include it in your JSP like :

Code:
<%@ include file="functions.inc" %>

Personally, I think this would be not a very nice way do it, and I would much prefer :

2) Create a util or helper class that performs generic functions relative to your site. This obviously means you need to compile the class, know about packages, import statements and the like to implement this more neat method.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top