Tips of using JSTL

how to deal with

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?
1,490 views 0 replies