default skinning for my first application
richard.waehner Aug 3, 2011 12:00 PMHi
I'm trying to get my first webapp pimped with a standard richfaces4 skin.
I've got one index.xhtml, my web.xml and one backing bean. But my app is still plained text. What else do I need to add to get this beautiful blue theme?
index.xhtml
{code: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">
<ui:component xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
<rich:extendedDataTable value="#{dataprovider.persons}" var="person" selectionMode="single">
<a4j:ajax execute="@form"
event="selectionchange"
render=":res" />
<h:column id="name">
<f:facet name="header">
<h:outputLabel value="Name"/>
</f:facet>
<h:outputLabel value="#{person.name}"/>
</h:column>
<h:column id="age">
<f:facet name="header">
<h:outputLabel value="Alter"/>
</f:facet>
<h:outputLabel value="#{person.age}"/>
</h:column>
</rich:extendedDataTable>
<rich:tabPanel switchType="client">
<rich:tab header="Tab 1">
Text 1
</rich:tab>
<rich:tab header="Tab 2">
Text 2
</rich:tab>
</rich:tabPanel>
</ui:component>
{code}
web.xml
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.enableControlSkinning</param-name>
<param-value>enable</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
{code}