This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSP and the fly likes custom methods in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "custom methods in jsp" Watch "custom methods in jsp" New topic

custom methods in jsp

Alfonso Harding
Ranch Hand

Joined: Feb 09, 2002
Posts: 35
can someone tell me whats wrong with this code??
Garann Means
Ranch Hand

Joined: Jan 28, 2002
Posts: 214
I think you need to send "out" to the callMe method, or it won't know what you want it to do. So it would be more like this:
Originally posted by Alfonso Harding:

Note that I'm not positive "out" is a PrintWriter, so I can't guarantee you this works as is.
John Wetherbie

Joined: Apr 05, 2000
Posts: 1449
Try this...

A couple notes. You don't need to import java.lang, it is imported automatically just as in a regular Java class. For testing things out having Java code in your JSP is OK but you should try to avoid code in your JSP as much as possible. If you want to avoid using a bean, and there are reasons to do this, you may want to use a custom tag to do what you want to do.
It also helps to include the error messages you are seeing along with your code to help the troubleshooting along.
Hope this helps and good luck!
[ October 24, 2002: Message edited by: John Wetherbie ]

The only reason for time is so that everything doesn't happen all at once.
- Buckaroo Banzai
I agree. Here's the link:
subject: custom methods in jsp
It's not a secret anymore!