JSF message bundles & bean methods warnings

Hello,

1/
in my JSF page, IDEA still complains "Cannot resolve variable labels" on this code:

#{labels['item1.item2']}

When I add this to my page:

<f:loadBundle basename="package.labels" var="labels"/>

warning disappears but this declaration is redundant when I declare bundle in faces-config.xml.

EDIT:
Code completition works, with or without <f:loadBundle basename="package.labels" var="labels"/>

2/
IDEA also complains "Cannot resolve property or method item1.item2" on the same code:
#{labels['item1.item2']}

but the page is correct and runs well.

3/
<h:commandButton value="OK" action="#{bean.createPerson}"/>
again warning "cannot resolve method" appears - code runs fine.

Can I somehow 'tune' these warnings?
Thank you

10 comments

Nobody working with JSF hasn't run accross this problem before? :(

0

Nobody working with JSF hasn't run accross this problem before?


Yes, I have not run accross this problem never before.

Seriously: Do you

  • use JSF 1.2 ?

  • define the bundle using "<resource-bundle>" ?


If so, then go ahead and create an issue in JetBrains' Jira to request that Idea supports the new tag "resource-bundle" for JSF 1.2.

0

I've found how to reproduce first two problems but more detailed info on
third problem is required

tomL wrote:

Hello,

1/
in my JSF page, IDEA still complains "Cannot resolve variable labels" on this code:

#{labels['item1.item2']}

When I add this to my page:

<f:loadBundle basename="package.labels" var="labels"/>

warning disappears but this declaration is redundant when I declare bundle in faces-config.xml.

2/
IDEA also complains "Cannot resolve property or method item1.item2" on the same code:
#{labels['item1.item2']}

but the page is correct and runs well.

3/
<h:commandButton value="OK" action="#{bean.createPerson}"/>
again warning "cannot resolve method" appears - code runs fine.

Can I somehow 'tune' these warnings?
Thank you



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Maxim,

I see the 3rd problem too. No Action method ever satisfies the warning. Is the problem that IDEA should accept methods for Action that return String, have no parameters, and don't start with get? The warning doesn't seem to like any Action method from any bean.

Jon

0

What type of JSF implementation you are using?
What is the name of the offending attribute name?

Jon Steelman wrote:

Maxim,

I see the 3rd problem too. No Action method ever satisfies the warning. Is the problem that IDEA should accept methods for Action that return String, have no parameters, and don't start with get? The warning doesn't seem to like any Action method from any bean.

Jon



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

IDEA derives method signature filter for the tag depending on JSF
implementation used (e.g. is there 'deferred-method' in attribute
declaration ) and attribute name (when former information is not
available). In particular, when using MyFaces and 'action' then 'any
method is accepted'

Jon Steelman wrote:

Maxim,

I see the 3rd problem too. No Action method ever satisfies the warning. Is the problem that IDEA should accept methods for Action that return String, have no parameters, and don't start with get? The warning doesn't seem to like any Action method from any bean.

Jon


--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

We are using MyFaces. Sample Actions include:

action="#{NewVehicleSpecialBean.step1Action}"
action="#{VehicleDetailBean.showVehicleDetail}"

Note that the beans are resolved and have no warnings.

0

Does the method (e.g. step1Action) declared in subclass of the bean
declared class?

Jon Steelman wrote:

We are using MyFaces. Sample Actions include:

action="#{NewVehicleSpecialBean.step1Action}"
action="#{VehicleDetailBean.showVehicleDetail}"

Note that the beans are resolved and have no warnings.



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

No - the method is directly in the bean declared class. That bean declared class happens to be a subclass of something besides Object but the method is not from the superclass either.

0

Ok,I'm glad you can reproduce it (and fix it ;))

The third problem suddenly disappeared...I didn't make any changes, maybe restart solved it, I don't know...

0

Please sign in to leave a comment.