Putting JSF components in a hierarchy based on subfolders

I roughly follow this guide to creating composite components in JSF 2.2. I managed to identify and use the component, but I have problems with the proper organization of the components. In all tutorials, components are placed in the same directory, and file names determine the tag name.

META-INF/resources/ts
                   +-plainbox.xhtml
                   +-showcasebox.xhtml

I would prefer to have categories and a directory for each item, including JS, CSS and images. I would like to use a structure like this:

META-INF/resources/ts
                   +-containers
                   |  +-plainbox
                   |  |  +-plainbox.xhtml
                   |  |  +-plainbox.css
                   |  +-showcasebox
                   |     +-showcasebox.xhtml
                   |     +-showcasebox.js
                   +-otherstuff
                      +-...

Unfortunately, when using this structure, I need to refer to each component by its own namespace:

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:jsf="http://xmlns.jcp.org/jsf"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:ts="http://java.sun.com/jsf/composite/ts/containers/showcasebox"
    xmlns:ts2="http://java.sun.com/jsf/composite/ts/containers/plainbox">
<head jsf:id="head">
</head>
    <body>
        <ts:showcasebox>hello world</ts:showcasebox>
        <ts2:plainbox>foo bar</ts2:plainbox>
    </body>
</html>

, . , .

JSF ? , Primefaces? Java?

+1

All Articles