<%@page contentType="text/html;charset=UTF-8"%> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <%@ taglib prefix="s" uri="http://shale.apache.org/core"%> <%-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --%> <h:outputText value="#{messages['usecases.clay']}" />

This webapp shows several ways to use Shale Clay to build reusable views. It mixes view technologies. This application uses several types of templates that are entry points in defining pages (JSP, HTML, and XML). This is most likely not a normal scenario and not something natively supported by JavaServer Faces. JSF encourages only one type of page entry point.

All JSF managed views must be dispatched through the faces servlet that behaves as the front in controller. JSF also allows you to to define the suffix you will be using for your page template technology and only one is allowed. Both of these settings are defined in the [Web deployment descriptor] .

This application bends the rules using a Shale Application Manager preproces filter [chain command] to intercept the URI before it is normalized into the viewId. The view id identifies the view root. Normally the view Id is forced into having the default suffix defined in the [web.xml] . This is really only important for JSP support. The faces servlet needs a url pattern to handle incoming request. This is generally suffix mapping of "*.faces". JavaServer Pages conventionally have a suffix of ".jsp" and wouldn't be handled correctly by the container if they were mapped to a servlet. The default suffix setting replaces the suffix of resources that have been handled by the faces servlet.

In most applications you will choose one type of template as your page entry point. Therefore, you will only need one servlet mapping and the default suffix parameter should match your servlet mapping choice.