First you have to include math.jsp in sum.jsp using <@include file="math.jsp" %>. After this directive you can call the method addTwoIntegers which is defined in the math.jsp
Regs, Dhanasekaran. -- --------- Original Message --------- DATE: Wed, 4 Jun 2003 17:37:05 From: Leviaguirre Queral Josi Luis <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Cc: >Hello, > >Does anybody knows how to call a method defined in another *.jsp file? Is it possible? > >I have a math.jsp that has a method called addTwoIntegers(int a, int b). I want >sum.jsp to call this method. > >I am trying something like this: > >---math.jsp-- ><%! >// adds two integers >public int addTwoIntegers(int a, int b){ > return a+b; >} >%> > >---sum.jsp--- ><%= out.println(math.jsp.addTwoIntegers(5,7))%> > >Thanks a lot, > >JLL.- > >[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL >PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL >PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@^@ >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". >For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". > >Some relevant archives, FAQs and Forums on JSPs can be found at: > > http://java.sun.com/products/jsp > http://archives.java.sun.com/jsp-interest.html > http://forums.java.sun.com > http://www.jspinsider.com > ____________________________________________________________ Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! http://login.mail.lycos.com/r/referral?aid=27005 =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com