I have a request object with String attribute name1. When request is sent to JSP I would like to use name1 parameter as a name of application scope bean to retrieve its status. I have tried
<jsp:getProperty name="${name开发者_高级运维1}" property="status" />
and
${${objName}.status}
and
${applicationScope.${objName}.status}
but it does not work.
You cannot nest EL expressions. It's one expression. Use the brace notation.
${applicationScope[objName].status}
See also:
- Hidden features of JSP/Servlet
精彩评论