another error highliting question (JSP)...

Sorry if the solution is obvious, I can't seem to find the answer in the docs.

After upgrading to 5.0 i noticed that the keys in my <bean:message key="foo.bar.baz"/> are being marked red: "cant resolve symbol foo.bar.baz"

the code works fine, it's just that idea can't reference the MessageResources file as defined in struts.config

How do I configure this in IDEA? or can I?

12 comments
Comment actions Permalink

I'll get this same thing when using from example jstl tag fmt <fmt:message key="foo.bar"/>

The problem is that IDEA cannot find my resource files. Is there somewhere place where you can define where to search for the properties files?

Version is also 5.0

0
Comment actions Permalink

To answer myself... Last I found the problem. My properties files was assigned as text files and thus wasn't working. So at least this fixed for me:
- settings > file types
- open text files and remove properties
- open properties files and add "properties"
- restart IDEA

Hopefully this helps other people too!

0
Comment actions Permalink

good thought. now I'm half way there.

I can ctrl-space to see the list of variables, but they still get red highlighting...

anyone else out there have an thoughts on this? I wonder if this is a bug from upgrading, vs a clean install?

0
Comment actions Permalink

I'm sure that this is due the importing settings from 4.5.4. I made also clear install to another machine and there the properties are assosiated correctly.

I just found out that still our <c:url value="/something/some.html"/> is shown as red, because of how our project directories are set. It would be nice to have more control over what is the root directory where IDEA is starting to look for files.

0
Comment actions Permalink

Now, what about expression language in the key property?
<fmt:message key="${lets.calculate}"/> highlights ${lets.calculate} in red. key property is run-time according to jstl standard, and it does work when deployed.

0
Comment actions Permalink

I am getting this too ... all include files are red, as in:

<%@ include file="/includes/pageDefs.jsp" %>

What is the workaround for this? I notice I can remove the forward slash in many cases to make the red turn green.

Is there a simple config fix?

0
Comment actions Permalink

Timothy Falconer wrote:

I am getting this too ... all include files are red, as in:

<%@ include file="/includes/pageDefs.jsp" %>


Since it sometimes works with relative paths (without the initial
slash), it sounds a bit like the web root is not configured correctly.
Check Settings / Modules / Web Module Settings / Web Resource
Directories. Is the physical directory that contains "includes"
correctly mapped to the "/" path relative to deployment root?

0
Comment actions Permalink

This did the trick. Seems my Web Resources got set to the WEB-INF directory only in the wizard. Not sure why.

Ie, it had the mapping:

/home/user/www/approot/WEB-INF -> /WEB-INF

I deleted this and put:

/home/user/www/approot -> /

0
Comment actions Permalink

I'm also getting the red squigglies on jstl runtime tags.

If I do this:

<c_rt:url var="blah" value="< =HttpRequestHelper.getSecureAction("blah")%>"/>

I get "cannot resolve symbol errors".

If I use the exact same code in the same page in a <c_rt:set tag, IDEA resolves it perfectly.

It looks like its only some of the tags not picking up the imports.

0
Comment actions Permalink

By fluke i fixed my problem (i had html error highlighting problem as well: can not resolve symbol)

Here is what i did to my web module to fix:

Settings/Modules/Paths

If your root folder (in Add Content Root) is marked as Sources ---> unmark it

thats it ... worked for me

0
Comment actions Permalink

I believe, for c_rt:url and c:url IJ is trying to resolve to a resource (as opposed to c:set). I have a similar problem when referencing a servlet. For example,

< c:url value="/DoSomething.do" /> highlights and complains with "cannot resolve symbol."

nor does < c:url value="http://www.jetbrains.com/" /> work (which I believe is a valid use of c:url).

Whereas,
< c:url value="/images/icon.gif" /> works fine (of course, as long as IJ can resolve /images and icon.gif exists.)

0
Comment actions Permalink

I hope I have solution.
You must correctly define *.properties file as properties not as text file.

And then you unmark all src in Settings/Modules/Paths
and apply this change a then again mark src back a and apply change.

now it's worked.

0

Please sign in to leave a comment.