• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Properties, Attributes and Parameters

Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Properties, Attributes and Parameters. More I read, more confused I am . Can anybody help me differenciate between Properties, Attributes and Parameters.

Thanks in advance.
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is very broad, I will try to make it short. A good book like "Head First Servlet and JSP" would be your best bet to understand these concepts completely.

Normally when we talk about properties in JSP, it is meant for properties in JavaBean that we use by specifying <jsp:useBean> action in JSP page. JavaBean is a java class where you must have a setter and a getter method for each member in the class and a non-argument constructor. The purpose of using JavaBean is to present data in JSP code with a much cleaner way.

Parameters are designed for passing arguments to servlet. It can be static (when you define initial parameters in deployment descriptor), dynamical (at runtime via browser) or programmatical (if you use dispatcher, or redirect to another resource). Parameters can only be type of String but you can have multiple values mapped to the same name.

Attributes are for sharing and storing information in servlet/jsp and among servlet/jsp. It has three scopes in servlet and four scopes in JSP. It can be used to store any type of object, but you can only map one value to one name in a given scope.

Have you no shame? Have you no decency? Have you no tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic