• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

scripting variables

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is scripting variables?
 
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!!
 
Author
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic