I don't understand the classpath requirements for facelets and CDI on glassfish. I'm using Netbeans, and have the following:
when I look at javaee-api it has javax.enterprise.context.ApplicationScoped and javax.inject.Named which are the particular imports being used in the bean. The facelets part is working, the template navigates correctly. It deploys to Glassfish and runs, except...there's no output from the @Named bean:
from the page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
This and everything before will be ignored
This and everything after will be ignored
Everything I read says to use CDI, that it's preferable now. I'm using EL, or more specifically, UEL, correctly, I believe. I'm largely following Facelets Essentials:
and am just trying to get the template client to invoke NextClient.getNext() with the EL of nextClient.next, but nothing happens...there's no stacktrace or error in glassfish:
the page displays as:
well, now I'm baffled. Now it's working. I can't figure what I did for the life of me...that's the desired output, each time the page is accessed the counter increments.
Now it works. Is this on the right track? Way off base? I have an entity class from a database which I'd like to link up to this, and output the class.
I can inject the entity into NextClient? I'm trying to do the "R" for Read in a CRUD application with CDI and facelets (using templates).
I've found much reference material on EJB, but it seems a mishmash. I just want to use CDI. What am I doing right/wrong, or, besides the PDF from Oracle on Java EE 7, what are good CDI reference material's? Much of what's on the web is woefully out of date, or not applicable to using CDI.
... It deploys to Glassfish and runs, except...there's no output from the @Named bean: ...
If you meant just starting up the server where the app is deployed then you will not see any output unless you are printing to the console at the startup. You would need to access for example a page in order to see an output.
CDI is the way JEE environment used to inject & manage dependencies. If you packaged them properly they should be available to be accessed from within the in the application.