XHTML Editor and JSF Custom Component and Namespace resolution problem [message #620451] |
Wed, 06 January 2010 09:27  |
Eclipse User |
|
|
|
Hi everybody,
I have a problem developing custom jsf component, particulary with the resolution of the namespace of my custom components library in design time.
I have 2 projects.
A java project (CustomComponent) with this structure:
[CustomComponent]
+ src/com.foo.components
+ component clases, renderers, etc.
+ META-INF [dir]
+ facelet
+ custom-component.taglib.xml
+ faces-config.xml
+ custom-component.tld
A web project to test my library.
[ComponentShowcase]
+ src/com.foo.mbeans
+ META-INF (empty)
+ WEB-INF
+ lib
+ web.xml
+ faces-config.xml
+ home.xhtml
So, in the web project i have defined the dependencies (ComponentShowcase have a reference to CustomComponent project). When i edit the home.xhtml file, and add the namespace (defined in the custom-component.taglib.xml)
<?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:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:lab="http://www.components.com/components">
<head>
<title>
<ui:insert name="title">Default title</ui:insert>
</title>
</head>
<body></body>
</html>
The editor validate the namespace and show: "Can't find facelet tag library for uri http://www.components.com/components"
The only solution that i have found for this problem is copying the custom-component.taglib.xml and custom-component.tld to the META-INF directory of the web project. With these files in the META-INF directory, can i reference my custom tags in the xhtml editor.
So ... my question is:
if it's possible avoid to copy those files to the web project and make a reference to the java project, to make the editor found the tag library (my idea is make a jar to distribute my components) ?
Thanks in advance!.
Mauro.
|
|
|
|
Powered by
FUDForum. Page generated in 0.30105 seconds