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 scripting variables 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 "scripting variables" Watch "scripting variables" New topic

scripting variables


Joined: Aug 02, 2002
Posts: 1
What is scripting variables?
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Welcome to the Java Ranch, we hope you�ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!
Shawn Bayern
Ranch Hand

Joined: May 06, 2002
Posts: 160
Originally posted by lsa:
What is scripting variables?

In a JSP page, scripting variables are variables you can use in the page's scripting language, which is typically Java. For instance, in
<%= foo.getBar() %>
'foo' is a scripting variable. You can declare scripting variables using the <jsp:useBean> tag or, in Java, manually within a scriptlet:
<% Customer foo = getCustomer(); %>
Also, custom tags in JSP can declare scripting variables.
Scripting variables, and the very notion of in-page scripting with Java, are rapidly becoming obsolete; many page authors have abandoned them in favor of custom tags entirely. JSTL (JSP Standard Tag Library) tags, in fact, don't even declare scripting variables. Instead, they use an expression language for accessing variables in your pages. So you get to write
instead of
((Customer) pageContext.findAttribute("name")).getName()
You can find out more about JSTL at
Hope that helps,

Shawn Bayern<br />"JSTL in Action" <a href="" target="_blank" rel="nofollow"></a>
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Thanks for changing your name however, you might have missed the part inthe naming rules that says use a first name, a space, and a last name.
Please change it to a follow the guidelines.
I agree. Here's the link:
subject: scripting variables
It's not a secret anymore!