Issue
In Jsp,what's the difference between ${param.name}
and ${param[name]}?
I've tested that they can both get the parameter I set from a servlet,but I want to find out the difference between them.e.g,in what sittuaton,one can work while another one doesn't?
Thanks in advance.
Solution
All the following ways are evaluated same in standard JSP EL:
${param.myvar}
${param[name]} // here `name` is another EL variable with value `name = "myvar"`
${param["myvar"]}
${param['myvar']}
If you're referring to a variable, then you can use 2nd one. Otherwise if you're directly accessing through value, then you can use 3rd or 4th one.
Answered By - Raman Sahasi