Re: Richfaces 4 & Pretty Faces 3.3.0 Runs On Glassfish 3.1

Splash Forums PrettyFaces Users Richfaces 4 & Pretty Faces 3.3.0 Runs On Glassfish 3.1 Re: Richfaces 4 & Pretty Faces 3.3.0 Runs On Glassfish 3.1

#21219

Justinus
Participant

Libraries

  • Richfaces 4.0.0.Final
  • Prettyfaces 3.3.0
  • Glassfish3.1,JSF2.1

relevant files

pretty-config.xml

<?xml version="1.0" encoding="UTF-8"?>

<pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.3.0"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://ocpsoft.com/prettyfaces/3.3.0 http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.0.xsd">

<url-mapping id="index">

<pattern value="/" />

<view-id value="/html/index.jsf" />

</url-mapping>

<url-mapping>

<pattern value="/style/2c-hd-lc-static-layout" />

<view-id value="/stylesheet/2c-hd-lc-static-layout.css" />

</url-mapping>

<url-mapping>

<pattern value="/style/2c-hd-lc-static-presentation" />

<view-id value="/stylesheet/2c-hd-lc-static-presentation.css" />

</url-mapping>

</pretty-config>

web.xml

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"

xmlns:xml="http://www.w3.org/XML/1998/namespace" 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 ">

<display-name>Archetype Created Web Application</display-name>

<context-param>

<param-name>facelets.DEVELOPMENT</param-name>

<param-value>true</param-value>

</context-param>

<context-param>

<param-name>javax.faces.DEFAULT_SUFFIX</param-name>

<param-value>.xhtml</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>*.jsf</url-pattern>

</servlet-mapping>

</web-app>

Template.xhtml

<html xmlns="http://www.w3.org/1999/xhtml"

xmlns:ui="http://java.sun.com/jsf/facelets"

xmlns:h="http://java.sun.com/jsf/html"

xmlns:f="http://java.sun.com/jsf/core"

xmlns:a4j="http://richfaces.org/a4j"

xmlns:rich="http://richfaces.org/rich">

<h:head>

<title><ui:insert name="title">Default title</ui:insert></title>

<link rel="stylesheet" type="text/css"

href="#{request.contextPath}/style/2c-hd-lc-static-layout" />

<link rel="stylesheet" type="text/css"

href="#{request.contextPath}/style/2c-hd-lc-static-presentation" />

</h:head>

<h:body>

<div id="header">

<ui:insert name="header">

<ui:include src="header.xhtml" />

</ui:insert>

</div>

<div id="leftColumn">

<ui:insert name="navigator">

<ui:include src="navigator.xhtml" />

</ui:insert>

</div>

<div id="content">

<div id="contentBody">

<ui:insert name="content">

</ui:insert>

</div>

</div>

</h:body>

</html>

index.xhtml

<ui:composition xmlns="http://www.w3.org/1999/xhtml"

xmlns:ui="http://java.sun.com/jsf/facelets"

xmlns:h="http://java.sun.com/jsf/html"

xmlns:f="http://java.sun.com/jsf/core"

xmlns:a4j="http://richfaces.org/a4j"

xmlns:rich="http://richfaces.org/rich" template="template.xhtml">

<ui:define name="title">

<h:outputText value="#{indexController.title}" />

</ui:define>

<ui:define name="content">

<rich:panel>

<h:outputText value="xXx" />

</rich:panel>

</ui:define>

</ui:composition>

Expected Behavior

all css should be loaded correctly

Actual Behavior

custom css (#{request.contextPath}/style/2c-hd-lc-static-layout) are loaded correctly.

while the css of richfaces could not be loaded.