EL & Struts Error Checking

I have recently upgraded to 6.0.1

I have noticed that now I have many more warnings and errors in some of the
files (jsps, classes and xml)

Background: I use Spring MVC/Hibernate w/Annotations and Commons validation
together (other stuff too that I don't believe matter)

1) I see warnings for all my EL status such as ${bean.id} that say "cannot
resolve variable bean". The variable is set in my Spring Controller so I
wouldn't expect IntelliJ to know that but I would like to not see these as
warnings.

2) In my validation.xml file which configures my Commons Validation...
IntelliJ is marking many items Red and saying "Cannot resolve Form Bean ]]>". This looks like it is Struts specific, which makes sense because it
was designed originally for Struts... but it can also be used with Spring
and it is very annoying to see Red errors in files that aren't broken. I
turned off all Struts errors in Settings but they still show up.


Thanks for you help,
Steve


3 comments

Hello Steve,

I have recently upgraded to 6.0.1

I have noticed that now I have many more warnings and errors in some
of the files (jsps, classes and xml)

Background: I use Spring MVC/Hibernate w/Annotations and Commons
validation together (other stuff too that I don't believe matter)

1) I see warnings for all my EL status such as ${bean.id} that say
"cannot resolve variable bean". The variable is set in my Spring
Controller so I wouldn't expect IntelliJ to know that but I would like
to not see these as warnings.


One way to solve this is to declare them, like this:
<jsp:useBean id="foo" type="org.bar.Foo" scope="request"/>

Note the use of "type", not "class": this will never instantiate anything.
Declaring all external data dependencies of a page at the start serves as
a nice 'data contract'.
An additional advantage is that the JSP/JSPX editor will now give you full
property name completion etc.

Rod Johnson talks about this application of jsp:useBean in his original book,
in the "Views for the Web tier" chapter.
Btw, did you try the IdeaSpring plugin?

Regards,
-tt


0

You could also disable EL validation of course...


0

Please sign in to leave a comment.