You can create a method in JSP <%! String myname() { return "name"; } %>
It's the same as defining a servlet method. Remember that JSPs are singletons. I highly recommend using JavaBeans allowing for reuse and maintenance even if you make the method static. ----- Original Message ----- From: "Kenny G. Dubuisson, Jr." <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 22, 2002 3:59 PM Subject: Functions in JSP > I need to create a function that formats a data a certain way and I need to > be able to call it from within a JSP page. Would I create a JavaBean to do > this? It is my understanding that you can't create a function in a JSP > page...am I incorrect in that? Any pointers on how to handle this would be > appreciated. Thanks, > Kenny > > =========================================================================== > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://archives.java.sun.com/jsp-interest.html > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.jsp > http://www.jguru.com/faq/index.jsp > 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 FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com