This Question is Answered

1 "helpful" answer available (2 pts)
3 Replies Last post: Mar 23, 2014 11:32 AM by Behrang Saeedzadeh  
Behrang Saeedzadeh Newbie 74 posts since
Apr 24, 2003
Currently Being Moderated

Mar 20, 2014 11:07 AM

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 class="${fooMap.cssClass}">

...

</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

Alexander Chernikov JetBrains 1,227 posts since
Jan 11, 2007

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.

Alexander Chernikov JetBrains 1,227 posts since
Jan 11, 2007

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.

More Like This

  • Retrieving data ...