Brian, Use the import attribute of the page directive. See: http://developer.java.sun.com/developer/technicalArticles/javaserverpages/co de_convention/
Regards, Richard > -----Original Message----- > From: Brian Allen [SMTP:[EMAIL PROTECTED] > Sent: Wednesday, June 04, 2003 8:06 PM > To: [EMAIL PROTECTED] > Subject: Re: Calling a Class or method from inside a jsp. > > What is the proper way to import a class into a JSP if I have the class in > the WEB-INF\classes folder? > > ----- Original Message ----- > From: "Richard Yee" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, June 04, 2003 10:14 PM > Subject: Re: Calling a Class or method from inside a jsp. > > > > Jose, > > Why don't you just create a class with a addTwoIntegers(int a, int b) > > static method? It probably can be done your way, but is much better to > have > > the Java code in a Java class rather than mixed in with your JSP markup. > > > > -Richard > > > > At 08:23 PM 6/4/2003 -0500, you wrote: > > >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.- > > > > > > > > >Jose Luis Leviaguirre Queral > > >Programador Zentrum ZiztemaZ > > >Of. 5223-8476 > > > > > > > > >"La libertad es una capa de merengue entre dos galletas de hojaldre." > > >(Carlos Valls) > > > > > > > > > > > >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 > > > > > ========================================================================== > = > > 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 > > > > ========================================================================== > = > 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 =========================================================================== 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