Skip to content

Commit

Permalink
Fix ticket route, don't show admin sections on Error page
Browse files Browse the repository at this point in the history
  • Loading branch information
lincolnthree committed Apr 8, 2014
1 parent 9f85cb4 commit 21437ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,23 @@ public Configuration getConfiguration(ServletContext context)
.and(Resource.exists("/{p}.xhtml"))
.andNot(ServletMapping.includes("/{p}")))
.perform(SendStatus.error(404))
.where("p")
.matches(".*")
.where("p").matches(".*")

/*
* Application Routes
*/
.addRule(Join.path("/{p}/").to("/faces/{p}/index.xhtml"))
.when(Resource.exists("/{p}/index.xhtml"))
.where("p")
.matches(".*")
.where("p").matches(".*")

.addRule(Join.path("/{p}").to("/faces/{p}.xhtml"))
.when(Resource.exists("/{p}.xhtml"))
.where("p")
.matches(".*")
.where("p").matches(".*")

.addRule()
.when(DispatchType.isRequest().and(Direction.isInbound())
.and(RequestParameter.exists("ticket")).and(Path.matches("/auth")))
.perform(Redirect
.temporary(context.getContextPath() + "/index.html"));
.perform(Redirect.temporary(context.getContextPath()));
}

@Override
Expand Down
16 changes: 7 additions & 9 deletions src/main/webapp/error.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
template="/resources/scaffold/pageTemplate.xhtml">
xmlns:h="http://java.sun.com/jsf/html"
template="/resources/scaffold/mainTemplate.xhtml">

<ui:param name="pageTitle" value="Server error" />

<ui:define name="header">
Oops
</ui:define>

<ui:define name="subheader">
That's going to leave a mark!
</ui:define>

<ui:define name="main">
<h1>
Sorry, something went wrong. Please try again or return
<h:link outcome="/index.xhtml">&rarr; home</h:link>.
</h1>

<p style="text-align: right; padding-top: 150px">
<a target="_blank" href="http://jboss.org"><img
src="#{resource['jboss-community.png']}"
Expand Down

0 comments on commit 21437ba

Please sign in to comment.