Blame view

war/src/main/webapp/WEB-INF/pages.xml 2.76 KB
Krzysztof Miksa authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
<?xml version="1.0" encoding="UTF-8"?>
<pages 
	xmlns="http://jboss.com/products/seam/pages"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd"
	no-conversation-view-id="/home.xhtml"
	login-view-id="/login.xhtml"
>

	<page view-id="/home.xhtml">
		<rewrite pattern="/" />
		<rewrite pattern="/index{.*}" />
		<rewrite pattern="/home{.*}" />
		<rewrite pattern="/default{.*}" />
		<rewrite pattern="/welcome{.*}" />
	</page>
	
	<page view-id="/login.seam">
		<rewrite pattern="/login"/> 
	</page>

	<page view-id="*">
		<navigation from-action="#{identity.logout}">
			<redirect view-id="/home.xhtml"/>
		</navigation>
   
		<navigation>
			<rule if-outcome="home">
				<redirect view-id="/home.xhtml" />
			</rule>
		</navigation>
	</page>
	
	<exception class="org.jboss.seam.framework.EntityNotFoundException">
		<redirect view-id="/error.xhtml">
			<message severity="warn">Record not found</message>
		</redirect>
	</exception>
	
	<exception class="javax.persistence.EntityNotFoundException">
	  <redirect view-id="/error.xhtml">
	    <message severity="warn">Record not found</message>
	  </redirect>
	</exception>
	
	<exception class="javax.persistence.EntityExistsException">
	  <redirect view-id="/error.xhtml">
	    <message severity="warn">Duplicate record</message>
	  </redirect>
	</exception>
	
	<exception class="javax.persistence.OptimisticLockException">
	  <end-conversation/>
	  <redirect view-id="/error.xhtml">
	    <message severity="warn">Another user changed the same data, please try again</message>
	  </redirect>
	</exception>
	
	<exception class="javax.persistence.PersistenceException">
		<redirect view-id="/error.xhtml">
			<message>The operation failed, please try again</message>
		</redirect>
	</exception>
	
	<exception class="org.jboss.seam.security.AuthorizationException">
		<end-conversation />
		<redirect view-id="/security_error.xhtml">
			<message severity="error">You do not have permission to access this resource</message>
		</redirect>
	</exception>
	
	<exception class="org.jboss.seam.security.NotLoggedInException">
	  <redirect view-id="/login.xhtml">
	    <message severity="warn">#{messages['org.jboss.seam.NotLoggedIn']}</message>
	  </redirect>
	</exception>
	
	<exception class="javax.faces.application.ViewExpiredException">
	  <redirect view-id="/error.xhtml">
	    <message severity="warn">Your session has timed out, please try again</message>
	  </redirect>
	</exception>
	
	<exception class="org.jboss.seam.ConcurrentRequestTimeoutException">
	  <http-error error-code="503" />
	</exception>
	 
	<exception>
	  <redirect view-id="/error.xhtml">
	    <message severity="error">Unexpected error, please try again</message>
	  </redirect>
	</exception>
    
</pages>