views:

49

answers:

2

I have a legacy JSF 1.0 application (using JSP, not facelets) which I have now migrated from MyEclipse to Eclipse 3.5 JEE, and I get a lot of errors from code similar to the following:

<f:view locale="#{foo.connection.langLocale}">

where the problem is that "foo" is explicitly inserted in the session object from Java code, and not injected by JSF or similar so Eclipse JEE thinks "foo" is undefined and marks this as an error. What is the proper way to tell Eclipse JEE that "foo" is perfectly fine, placed in the session object, and of type Foo?

+2  A: 

Either declare it in faces-config.xml as well, or disable JSP/JSF validation in Eclipse. It's an epic failure. You can do that through Window > Preferences > Web > JavaServerFaces Tools > Validation and JSP Files > Validation. Just uncheck those checkmarks in top. You can if necessary configure them less strictly over there.

BalusC
Your "epic failure" link refers to too many bugs for bugzilla to show. Your point?
Thorbjørn Ravn Andersen
It are actually two links. My point is that I, having used it more than 7 years, have ranted too often on the incorrectness of Eclipse's JSP/JSF/EL validator/autocompletion/etc. I remember, IntelliJ did it much better, but unfortunately the "Java EE" variant with JSP editor isn't freeware.
BalusC
A: 

The help guide lists your options for JSF Validation and EL Validation preferences.

It is likely that the only way tooling will pick up type information for beans is if they are registered in faces-config.xml.

McDowell