Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dumb question - variables

 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Being a thick-skulled greenhorn, I'm trying to get my head around the java in the JSP tags and I can't figure out how to use global variables or functions.
How can I declare a function in jsp java so that I can pass the parameters as reference parameters, not just copies? If it's anything like javascript, I can't, right?
How can I declare a global variable so that I can reference the variable inside functions and just in the script blocks?
Thanks
Adam
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For "global" variables and methods in JSP for use in a single application - you might declare a bean with application scope.
See the JSP API documentation downloadable from java.sun.com
Bill

------------------
author of:
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i see i am going to have commit some time to learning the servlet/bean techniques, but what really flummoxes me now is why some of my "global" variables work - e.g. i've got my database access in a function and it sets the result set object in a global variable, but it can't set the error/warning messages variable, although they're both declared in the same place.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic