The concept or the theory, is almost equals. (for some situations)
Parameters, are for a configurations of something, I mean, think about on certain behavior, that mean, that you can use parameters for a data base behavior, maybe you configure a parameter, for a a data base in particular, but maybe, another day you can configure that parameter for another database... i dont know if you see the point.
The attributes are most for sharing information on the application, for example, for share information, maybe you want share the name of the user logged, to another component (jsp/servlet), you can give me?
Maybe be you are mixing with initparamters and parameters (request parameters) Both of them are String. Init Parameters are of 2 types Context Init Paramters: Servlet Init Parameters: Both uses the method getInitParameter(String name) Normal paramters example form paramters : Accessor method is getParameter(String)
Attributes are objects and can be put into session,request and context
methods are setAttribute(String name,Object attr); Object getAttribute(String name);
============================================================================ Basic Difference which has already mentioned in this trail.. - Parameters are either of String or String type. Mostly it is not set by the Developer. - Attribute is of Object type. You always need to cast it before usage. It is always set and used by Developer. ============================================================================ Parameters are catagorized in 2 forms
1. Parameters 1a. Request Parameters - query String (Get) / request body (Post) 1b. include/forward request using jsp aram - Code** ** this is the only place, from where parameters can be set / added by Developer.
Attributes can be set and retrieved only from the Code. So attributes are always controlled by Developer. ============================================================================ You can also refer to Page 186 of HFJS 2nd Edition. ============================================================================