Permalink
Browse files

Removing faces-config.xml and adding instruction how to partially ena…

…ble the extensions
  • Loading branch information...
1 parent 677b786 commit f0c6a03491571a94ea8ad338b232f3fd2d134573 Adam Warski committed May 24, 2010
Showing with 28 additions and 22 deletions.
  1. +28 −1 README.txt
  2. +0 −21 src/main/resources/META-INF/faces-config.xml
View
@@ -77,10 +77,22 @@ By Gaving King, see http://in.relation.to/13053.lace.
5. Current locale holder
+To enable, add to faces-config.xml:
+
+<application>
+ <view-handler>pl.softwaremill.cdiext.i18n.CurrentLocaleViewHandler</view-handler>
+</application>
+
6. Writeable & read only entity managers
7. Transaction JSF phase listeners
+To enable, add to faces-config.xml:
+
+<lifecycle>
+ <phase-listener>pl.softwaremill.cdiext.transaction.TransactionPhaseListener</phase-listener>
+</lifecycle>
+
8. Fields equal validator
<h:inputSecret id="password" value="#{password}" />
@@ -98,6 +110,15 @@ A component for enqueing faces messages, which will survive redirects. Use:
@Inject
private FacesMessages facesMessages;
+To enable, add to faces-config.xml:
+
+<application>
+ <system-event-listener>
+ <system-event-class>javax.faces.event.PreRenderViewEvent</system-event-class>
+ <system-event-listener-class>pl.softwaremill.cdiext.messages.FacesMessagesListener</system-event-listener-class>
+ </system-event-listener>
+</application>
+
10. Navigation
Extend the NavBase to create a "nav" component and define any pages that you use the following way, using the PageBuilder:
@@ -114,4 +135,10 @@ You can then use the component either to return results of action methods or to
11. Restricting pages to logged in users only
-There must be a bean implementing the LoginBean interface; the bean controls if there's a logged in user.
+There must be a bean implementing the LoginBean interface; the bean controls if there's a logged in user.
+
+To enable, add to faces-config.xml:
+
+<lifecycle>
+ <phase-listener>pl.softwaremill.util.SecurityPhaseListener</phase-listener>
+</lifecycle>
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<faces-config version="2.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-facesconfig_2_0.xsd">
- <lifecycle>
- <phase-listener>pl.softwaremill.cdiext.transaction.TransactionPhaseListener</phase-listener>
- <phase-listener>pl.softwaremill.util.SecurityPhaseListener</phase-listener>
- </lifecycle>
-
- <application>
- <system-event-listener>
- <system-event-class>javax.faces.event.PreRenderViewEvent</system-event-class>
- <system-event-listener-class>pl.softwaremill.cdiext.messages.FacesMessagesListener</system-event-listener-class>
- </system-event-listener>
-
- <view-handler>pl.softwaremill.cdiext.i18n.CurrentLocaleViewHandler</view-handler>
- </application>
-</faces-config>

0 comments on commit f0c6a03

Please sign in to comment.