• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can you declare a function in a JSP page

 
Ray Smilgius
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<html>
<head><title>Number Guess</title></head>
<body bgcolor="white">
<% public void test
{
out.print("Test");
}
%>
</body>
</html>
Thanks Ray
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to make it a Declaration (it's worth reading the JSP syntax sheet available at the sun site)
It looks like this:

Be very wary of using JSP Declaration tags since they can make your JSPs no longer thread-safe (ie behave eratically when multiple access it at once)
Dave.
 
Ray Smilgius
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply,
I have heard of this thread issue before
Thanks ray
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!