June 1, 2004
Sometimes you will need to get an attribute from request or session. it's easy to use:
core:out value='${requestScope.attributeName}"
But, if the attribute's name is something like "aaa.bbb.ccc", you will have trouble. coz the JSTL will think you are trying to get a value ccc from object bbb from object ccc.
To dear with "." in such situation, use bracket, like this:
core:out value="${requestScope['aaa.bbb.ccc']}"
then it works, sweet, isn't it?
core:out value='${requestScope.attributeName}"
But, if the attribute's name is something like "aaa.bbb.ccc", you will have trouble. coz the JSTL will think you are trying to get a value ccc from object bbb from object ccc.
To dear with "." in such situation, use bracket, like this:
core:out value="${requestScope['aaa.bbb.ccc']}"
then it works, sweet, isn't it?
No comments:
Post a Comment