I think , the simplest way to overcome your problem's to build a utility packageincluding your're "foo" function , then simply import that package in"test1.jsp" .