Gary, I appreciate the information.  Ok, here is what I have and it is not
working.  Bear with me, I am going to post the bulk of my files, though they
are quite short.


[web.xml]
 <!-- Display name for this application -->
    <display-name>Shale Blank Starter App</display-name>

    <!-- Select JSF State Saving Mode -->
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>

    <!-- JSF Configuration Resources (comma-separated list) -->
    <context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>

    <!-- Commons Chain Configuration Resources -->
    <context-param>
        <param-name>org.apache.commons.chain.CONFIG_WEB_RESOURCE
</param-name>
        <param-value>/WEB-INF/chain-config.xml</param-value>
    </context-param>

    <!-- Dialog Configuration Resources (comma-separated list) -->
    <context-param>
        <param-name>org.apache.shale.dialog.CONFIGURATION</param-name>
        <param-value>/WEB-INF/dialog-config.xml</param-value>
    </context-param>

    <context-param>
        <param-name>clay-config-files</param-name>
        <param-value>/WEB-INF/clay-config.xml,/WEB-INF/clay-
symbols-config.xml</param-value>
    </context-param>

    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.html</param-value>
    </context-param>

    <!-- Shale Application Controller Filter -->
    <filter>
        <filter-name>shale</filter-name>
        <filter-class>
            org.apache.shale.faces.ShaleApplicationFilter
        </filter-class>
    </filter>

    <!-- Shale Application Controller Filter Mapping -->
    <filter-mapping>
        <filter-name>shale</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

    <!-- Commons Chain Configuration Listener -->
    <listener>
        <listener-class>
            org.apache.commons.chain.web.ChainListener
        </listener-class>
    </listener>

    <listener>
        <listener-class>
            org.apache.shale.clay.config.ClayConfigureListener
        </listener-class>
    </listener>

    <!-- JavaServer Faces Servlet Configuration -->
    <servlet>
        <servlet-name>faces</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- JavaServer Faces Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>faces</servlet-name>
        <url-pattern>*.faces</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>faces</servlet-name>
        <url-pattern>*.html</url-pattern>
      </servlet-mapping>

[clay-config.xml]
<view>

    <component jsfid="baseLayout" extends="clay" id="base">
        <attributes>
            <set name="clayJsfid" value="/templates/layout.html" />
        </attributes>
        <symbols>
            <set name="title" value="Hello World" />
            <set name="bodyContent" value="/pages/welcome.html" />
        </symbols>
    </component>

</view>

[clay-symbols-config.xml]
<view>

    <component jsfid="username" extends="inputText" id="username">
        <attributes>
            <set name="value" value="#{welcomeBean.username}"/>
            <set name="size" value="20"/>
            <set name="maxlength" value="30"/>
            <set name="required" value="true"/>
            <set name="immediate" value="true"/>
        </attributes>
    </component>

    <component jsfid="password" extends="inputSecret" id="password">
        <attributes>
            <set name="value" value="#{welcomeBean.username}"/>
            <set name="size" value="20"/>
            <set name="maxlength" value="30"/>
            <set name="required" value="true"/>
            <set name="immediate" value="true"/>
        </attributes>
    </component>

</view>

[layout.html]
<html>
<head>
    <title>
        Test
    </title>

</head>
<body>
<table width="100%" cellpadding="2" cellspacing="0" border="1">
    <tr>
        <td>
            <span jsfid="clay" clayJsfid="@bodyContent"
allowBody="false">Body Content</span>Body Content
        </td>
    </tr>
</table>
</body>
</html>

[welcome.html]
<table>
    <tr>
        <td>Username</td>
        <td><input jsfid="username" type="text"/></td>
    </tr>
    <tr>
        <td>Password</td>
        <td><input jsfid="password" type="password"/></td>
    </tr>
</table>

And when I go to http//localhost:8080/test/welcome.html I get a 500, page
cannot be found [welcome.html].  I have it under the web root pages dir and
I have layout.html under templates.  Looking for suggestions one what I have
done wrong.

Thanks.

Gregg

On 4/8/06, Gary VanMatre <[EMAIL PROTECTED]> wrote:
>
> >From: "Gregg Bolinger" <[EMAIL PROTECTED]>
> >
> > I am evaluating Shale. I realize it is a work in progress and that
> nothing
> > is fully finallized/stable and I expect there to be issues. I also
> expect
> > great things from Shale in the future and want to help track down issues
> for
> > development. Hence, my eval. I've got some questions about Clay...
> >
> > I have searched the mailing list archives and found psuedo answers to my
> > issues but nothing concrete. I am trying to utalize tapestry like views
> and
> > full HTML layout. I've read the online doc and downloaded and read the
> PDF
> > doc. I have also looked at the code for the Use Case Roladex which
> seemed
> > to just confuse me more. I know people have asked for a simpler example
> of
> > using Clay already, so I won't. But I would like some clarification.
> >
> > If I want to use tapestry like views and full html layout, do I need the
> > clay-template-suffix context param and do I need to map the servlet to
> the
> > same extension. Also the documentation shows the clay-template-suffix as
> > .clay and then the servlet mapping as .html. It states both should be
> the
> > same. Is HTML preferred?
> >
>
> The default suffix for the clay html views is .html.  You can override
> this if you want using the context param in the web.xml.
>
> <context-param>
>     <param-name>
>              org.apache.shale.clay.HTML_TEMPLATE_SUFFIX
>     </param-name>
>     <param-value>.clayh</param-value>
> </context-param>
>
>
> You also need to modify the faces servlet mapping so that the suffix you
> choose is handled by the faces servlet.
>
>   <servlet-mapping>
>     <servlet-name>faces</servlet-name>
>     <url-pattern>*.html</url-pattern>
>   </servlet-mapping>
>
>
> > Exactly what file should I place my component declarations in and where
> > should this file reside?
> >
>
> The component declarations can reside under the context root or within the
> classpath but both should be registered in the web.xml.
>
>    <!-- Clay Common Configuration Resources -->
>    <context-param>
>       <param-name>org.apache.shale.clay.COMMON_CONFIG_FILES</param-name>
>       <param-value>/WEB-INF/clay-config.xml, /WEB-INF/clay-
> symbols-config.xml</param-value>
>    </context-param>
>
> We borrowed the prefix of  "classpath*:" from spring to indicate the
> config file should be loaded with the class loader.
>
>    <context-param>
>       <param-name>org.apache.shale.clay.COMMON_CONFIG_FILES</param-name>
>       <param-value>classpath*:org/apache/shale/usecases/symbols/clay-
> tiles-config.xml</param-value>
>    </context-param>
>
> These files will be loaded on startup.  If you are only using full html
> views, you will need to add another param
> to the web.xml.  The usecase apps shows how to use three types of views in
> the same app (JSP, HTML, XML).
> This is probably not a normal usecase in the real world.
>
> <context-param>
>   <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
>   <param-value>.html</param-value>
> </context-param>
>
>
> > For full HTML layout, do I need a JSP that pulls in the appropriate
> template
> > using the clay-shale taglib?
> >
>
> No, the shale-clay.jar has a self registering view handler that detects
> the suffix (.html) defined in the web.xml.  So you don't even have to use
> a JSP.  There are a couple of the full HTML rolodex examples that show this
> option.  The *extreme* HTML rolodex example show that you don't have to use
> any XML configs.  The complete page is defined in HTML.
>
> The fun part to the clay is that it is a component and can be used in many
> ways.  When used in full html views, the clay component it the only child
> under the view root.
>
> > Is there currently any other documentation that I am not aware of
> concerning
> > Clay?
> >
>
> None that I'm aware of other than the website and the mailing list.  I
> think that Manning was considering a Shale book that had a couple chapters
> on using Clay but I'm not sure what the status is on that.  I've been
> threating to do some more of that but I'd rather contribute other ways.
>
> > Thanks a bunch and I look forward to Shale's growth.
> >
>
> Give it a look.  You might be able to help with that growth as many cool
> features like symbols came about the same way.
>
>
> > Gregg Bolinger
> >
>
> Gary
>

Reply via email to