Validator id is not registered - eclipse

i am getting this warning in eclipse:
Validator id is not registered
on the line:
<f:validator validatorId="confirmPasswordValidator" />
i am using JSF 2, and tomcat 6
and my el-impl library is org.glassfish.web
any ideas why ?
and how to solve it ?

Ignore and run it. Eclipse is relying on it being present as <validator> declaration in faces-config.xml the JSF 1.x way. It does by default not recognize #FacesValidator and likes yet and therefore don't see it already being registered by new JSF 2.x annotations. The upcoming newer Eclipse versions will.
You could consider to turn off JSF validation in Eclipse preferences, it will only lead to more confusion and annoyances. The upcoming JBoss Tools plugin 3.3 (currently still in beta) will support JSF annotations like #FacesValidator, #ManagedBean, etc.
Note that this is in no way related to EL. You aren't using #{} anywhere.

Related

Warning: The page declares namespace http://xmlns.jcp.org/jsf/core no TagLibrary associated to namespace in JSF on TomEE

I'm trying to create a page that validates url parameters and redirects to error page when parameters are not present.
Developing on TomEE 1.7.3 and Eclipse. Project set to Development mode. I'm targeting JSF 2.2.
I've used these questions:
Redirect before loading the page in JSF2
NLS missing message: CANNOT_FIND_FACELET_TAGLIB
My code works, however I'm getting warnings on Eclipse and on Server:
How can I rid of these warnings? Will these show in Production environment too?
First of all, TomEE 1.7.x ships with JSF 2.1, not 2.2. The migrated xmlns.jcp.org namespace domain is only available since JSF 2.2. Unless you've manually upgraded TomEE itself to use JSF 2.2, this won't work at all and you should keep using java.sun.com XML namespace domain.
How can I rid of these warnings?
Have a concrete JSF 2.2 implementation JAR file in project's Build Path. In case of Java EE servers, this is usually to be done by setting the server as Targeted Runtime in project's properties. The server plugin will then auto-reference server's own libraries in Build Path. Obviously, this will only work properly if the server plugin is decent and you have correctly upgraded the server itself to physically use JSF 2.2.
If this still doesn't work (because of poor server plugin), then download the individual JSF implementation JAR file, put it somewhere in project (but NOT in /WEB-INF/lib, otherwise it will conflict with server's own JSF impl during runtime and cause class/method/abstract related exceptions over all place), and add it to project's Build Path.
Will these show in Production environment too?
I can't imagine how as production servers usually don't run server via an IDE and HTTP clients usually aren't able to monitor the server's VGA output.

Can not find the tag library descriptor for "http://richfaces.ajax4jsf.org/rich"

I've been trying migrating my project from JSF 1.0 and RichFaces 3.1.4 to JSF 2.2 and RichFaces 4.5.2.
I want to keep the pages JSP formatted (is it even possible?)
While replacing the jars of RichFaces I get the following error:
Can not find the tag library descriptor for "http://richfaces.ajax4jsf.org/rich"
What is the cause to this error?
JSP is deprecated since JSF 2.0. It's succeeded by Facelets (XHTML). Therefore, JSF 2.0 compatible component libraries like RichFaces 4+ and PrimeFaces 2+ do not support JSP anymore. Those component libraries do not contain JSP taglibs anymore. Hence this error.
Migrate JSP to its successor Facelets.
See also:
Migrating from JSF 1.2 to JSF 2.0
Why Facelets is preferred over JSP as the view definition language from JSF2.0 onwards?

EL proposals / autocomplete / code assist in Facelets with Eclipse

I tried to activate EL proposals in a Facelets page, but when I hit Ctrl+Space, it doesn't work. I managed to activate JSF tag proposals thank to other questions, but EL proposals aren't working.
How can I activate this feature in Eclipse? Is it a known issue?
For example:
<h:inputHidden id="id" value="#{Ctrl+Space not working!}"/>
Eclipse doesn't support this out the box. Even the support in JSP is very limited. Only the properties of <jsp:useBean> and managed beans hardcoded as <managed-bean> in faces-config.xml are available by autocomplete. There are however plugins which supports EL autocomplete on #ManagedBean and #Named beans.
For example, the JBoss Tools plugin (specifically the CDI feature) which can be installed as described here: How do I Install JBoss AS / WildFly Server in Eclipse for Java EE.
(which has in its current 3.2.0 version unicode bugs, as you see above in the rightmost window)
You can even use Ctrl+Click on the managed bean name #{bean} in an EL expression in Facelets file to navigate to the concrete backing bean class. You can also use Ctrl+Shift+G on the managed bean method in a backing bean class to find all references to the particular property or action in Facelets files.
The Aptana plugin is told to work fine for EL proposals in JSPs, but I am not sure for Facelets. I didn't had good experiences with installing and configuring the plugin for JSP some years ago.
See also:
Properties of new tags using composite component are not displayed by Eclipse auto complete shortcurt

How to Get JSF 2.0 Working with Eclipse 3.5 and JBoss 5.1

I am running Eclipse 3.5 and JBoss 5.1. I want to create a JSF 2.0 project.
I heard here that the Eclipse JBoss Tools plugin version 3.1 (available here) could do this for me.
I have installed the plugin. However, if I go to the Project Facets properties page for a Dynamic Web Project, I only see Facets for JavaServer Faces 1.1 and 1.2. My Java facet is set at 6.0, and my Dynamic Web Module to 2.5.
In the Targeted Runtimes properties page, I see that I am targeting the JBoss 5.1 Runtime.
I understand that Eclipse Helios will be here next week, but I'm curious if its possible to get JSF 2.0 working with 3.5. Any thoughts?
Certainly you can. Just set to 1.2, give the JSF 2.0 libraries and it will work. It's after all just the code which you write. You'll maybe only miss the IDE assistance in JSF 2.0 specific features, but this doesn't harm if you know how to write code yourself. Heck, you can even do this all using plain notepad.exe and javac.exe ;)
See also:
Does the Eclipse IDE support JSF 2.0?

Does the Eclipse IDE support JSF 2.0?

I have the WTP 3.1 plugin installed and have also installed the Glassfish v3 plugin. I am able to register my server.
When I create a dynamic web project, I can see that the maximum dynamic web module version available is 2.5. I then choose the default configuration for Glassfish v3 but, when I look at it JSF, it is not selected by default. When I select it, the maximum version available is 1.2.
I want to use JSF with facelets - does Eclipse support this? I can't seem to find anything helpful on the Eclipse WTP site.
Java EE 6 / JSF 2.0 is relatively new. Most tools are already ready, but Eclipse has to catch up it yet.
The status as far:
IntelliJ Ultimate Edition was early in this. Unfortunately not freeware. Note: the free Community Edition doesn't provide tools for much of Java EE, let alone JSF.
Netbeans 6.8 came a bit later almost full Java EE 6 support, including JSF 2.0.
Eclipse for Java EE planned to support Facelets in Galileo, but it was cancelled and postponed to the successor Helios which is currently in one of its latest Release Candidate stages been released at 24 July 2010. Helios for Java EE will ship with full fledged Java EE 6 support, including JSF 2.0.
As of now, it just works fine in Eclipse Ganymede/Galileo when you select JSF 1.2 and uses JSF 2.0 libraries. You'll only miss some code assistance which may be useful for JSF 2.0, but you can write code as good yourself.
Use Eclipse with JBoss Tools Plugin. It has support for JSF2 and CDI.
http://in.relation.to/14750.lace
Note, that you can do JSF 2.0 development in Eclipse, but not with as much tool support as might come later.
You can always edit xhtml files directly as XML-files (and have the namespaces registered), and have Glassfish deployments. I've done that, with stock Eclipse 3.5.2 Java EE edition, and the Glassfish plugin.
Have a read on http://weblogs.java.net/blog/2009/05/18/using-ide-write-jsf-20-app
It describe in details on how to setup your eclipse for jsf 2.0 development.