Apr 25, 2004 #1 sparc20 Programmer Mar 13, 2002 56 GB Guys, do you know if i can delcare and implement methods within a JSP ? thanx
Apr 26, 2004 #2 sedj Programmer Aug 6, 2002 5,610 Yes : <%! String myMethod() { return "Hello"; } %> Upvote 0 Downvote
Apr 26, 2004 #3 LFI Programmer Apr 27, 1999 1,996 US Note, however, that if you want to use 'global' variables in these methods, you need to declare them within <%! ... %> tags as well. Obviously, you can also send the variables as parameters to the method. --Dave Upvote 0 Downvote
Note, however, that if you want to use 'global' variables in these methods, you need to declare them within <%! ... %> tags as well. Obviously, you can also send the variables as parameters to the method. --Dave
Apr 26, 2004 #4 sedj Programmer Aug 6, 2002 5,610 Be very, very careful declaring globals in a Servlet as they will be shared across all http request services ... Upvote 0 Downvote
Be very, very careful declaring globals in a Servlet as they will be shared across all http request services ...