This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I would like to report that the code completion is not working for expression language. For example, suppose the following code: @Named public class Message { public String getMessage() {return "Hi";} } Now, create a new XHTML file and invoke code completion inside a "#{}". Netbeans will not recognize the Message class anotated with '@Named'. This works fine in Netbeans 6.9.1, but fails in latest nightly build.
Works fine for me. Can you please specify in what kind of project this does happen? Or does this happen only in a particular project? If so, can you pack and attach it here? Thank in advance.
Hi! The problem occurs with Maven based web projects. Please, check it again: Create a new Maven web project and do the steps described. (In reply to comment #1) > Works fine for me. Can you please specify in what kind of project this does > happen? Or does this happen only in a particular project? If so, can you pack > and attach it here? Thank in advance.
I forgot to mention: the problem affects Netbeans 7.0 RC1. (In reply to comment #2) > Hi! > > The problem occurs with Maven based web projects. > > Please, check it again: > > Create a new Maven web project and do the steps described. > > > > (In reply to comment #1) > > Works fine for me. Can you please specify in what kind of project this does > > happen? Or does this happen only in a particular project? If so, can you pack > > and attach it here? Thank in advance.
I've tried following scenario: 1) run the latest dev build w/ brand new userdir 2) create maven web project 3) built the project 4) created a new java class beans.MyBean 5) added javax.inject.Named annotation to the class 6) added public String getMessage() {} method 7) created a new xhtml file 8) put #{} inside 9) invoked completion inside the curly brackets => the completion offers "myBean" item properly. 10) completed the item 11) typed . and invoked the completion again => the completion properly offers "message" item I'm sorry but since I cannot reproduce the issue I cannot do much for you. Could you please try to follow exactly all the steps above and report any differencies in the flow? I'd also like to ask our quality engineer Vlada for evaluation of the problem.
Works for me too, in both dev and rc2 build
Created attachment 107817 [details] EL code completion dialog example
Code completion appears to work for me for bean properties and action methods although the code completion dialog now has everything in alphabetical order as opposed to the application specific named beans first then the implicit attributes following. I am seeing what I perceive as an issue with EL code completion with regards to resource bundles. Given a properties file with a FQN of test.Messages and content including: TEST_MESSAGE=This is a test message Add a Faces Configuration file as follows: <?xml version='1.0' encoding='UTF-8'?> <faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"> <application> <locale-config> <supported-locale>en</supported-locale> <default-locale>en</default-locale> </locale-config> <resource-bundle> <base-name>test.Messages</base-name> <var>msg</var> </resource-bundle> </application> </faces-config> Spice up the web app with a named bean as follows: package test; import javax.enterprise.context.RequestScoped; import javax.inject.Named; @Named(value = "myBean") @RequestScoped() public class MyBean { private String testString1; public String getTestString1() { return testString1; } public void setTestString1(String testString1) { this.testString1 = testString1; } private String testAction() { return null; } } I then add an index.xhtml file as follows: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <title>Facelet Title</title> </h:head> <h:body> Hello from Facelets <h:form id="f" prependId="false"> <h:inputText id="it1" value="#{myBean.testString1}"/> <h:outputText value="#{msg['TEST_MESSAGE']}"/> </h:form> </h:body> </html> This will render just fine. The problem is that during development the code completion dialog, when invoked to the right of the open EL bracket, will show an entry properly named "myBean" but the resource bundle shows up as "test.Messages" rather than the var name ("msg") given in the faces-config file. Screen capture of code completion dialog attached.
(In reply to comment #4) > I've tried following scenario: > 1) run the latest dev build w/ brand new userdir > 2) create maven web project > 3) built the project > 4) created a new java class beans.MyBean > 5) added javax.inject.Named annotation to the class > 6) added public String getMessage() {} method > 7) created a new xhtml file > 8) put #{} inside > 9) invoked completion inside the curly brackets > => the completion offers "myBean" item properly. > 10) completed the item > 11) typed . and invoked the completion again > => the completion properly offers "message" item > > I'm sorry but since I cannot reproduce the issue I cannot do much for you. > Could you please try to follow exactly all the steps above and report any > differencies in the flow? > > I'd also like to ask our quality engineer Vlada for evaluation of the problem. The problem occurs when you change pom.xml from: <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> to: <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> maybe it will help in solving the problem
(In reply to comment #7) > an entry properly named "myBean" but the resource bundle shows up as > "test.Messages" rather than the var name ("msg") given in the faces-config > file. > > Screen capture of code completion dialog attached. I've checked in latest dev build and it works fine - the completion list shows item "msg test.Messages" and "msg" is completed if you press enter on the completion item.
> The problem occurs when you change pom.xml > from: > <dependency> > <groupId>javax</groupId> > <artifactId>javaee-web-api</artifactId> > <version>6.0</version> > <scope>provided</scope> > </dependency> > to: > <dependency> > <groupId>javax</groupId> > <artifactId>javaee-api</artifactId> > <version>6.0</version> > <scope>provided</scope> > </dependency> > > maybe it will help in solving the problem Works fine in 7.3 dev even if I do what you mentioned.