Cannot resolve property or method (dynamic property?) when using maps in JSP EL expressions
Hi,
We have a chunk of code like this in a JSP file (yeap, damn ugly scriptlets):
<%
Map<String, String> fooMap = new HashMap<String, String>();
fooMap.put("cssClass", "...");
%>
<c:set var="fooMap" value="<%= fooMap %>" />
<div >
...
</div>
IDEA marks ${fooMap.cssClass} in orange can complains that "Cannot resolve property or method (dynamic property?)"
Before filing a bug report I wanted to see if there's a way to suppress this warning for maps or if I am missing something.
Thanks,
Behrang
请先登录再写评论。
Thank you.
For me the warning has gone, when there is no space between opening "<%=" and fooMap reference in c:set element.
However, if the JSP works with space (have not checked it yet) then it is clearly a bug. Will check and search the bugtracker.
Common workarounds like turning inpection off or adding a comment (check quick fix options) are available.
Regards,
Alexander.
Reported: http://youtrack.jetbrains.com/issue/IDEA-122564
Maps do not matter. The same occurs with regular beans. The essential condition is the space I referred before.
Thank you for reporting,
Alexander.
Thanks. Looking forward for the fix.