• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scripting variables

 
newcity
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is scripting variables?
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lsa
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
Author
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
${customer.name}
instead of
((Customer) pageContext.findAttribute("name")).getName()
You can find out more about JSTL at http://java.sun.com/products/jstl
Hope that helps,
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
newcity
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.
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic