PageRenderTime 2ms CodeModel.GetById 82ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 1ms

/docs/documentation/error-pages.md

https://github.com/liny4cn/brightspot-cms
Markdown | 46 lines | 33 code | 13 blank | 0 comment | 0 complexity | 874f3ff83bfa3caf01e0227618118351 MD5 | raw file
 1---
 2layout: default
 3title: Error Pages
 4id: errorPages
 5section: documentation
 6---
 7<div markdown="1" class="span12">
 8
 9## Overview
10
11This section looks at how to create and manage error pages using Brightspot.
12
13## Error Page Element
14
15Start by adding your error-page elements to your web.xml and specifying the url on which they are accessed. Below the 404 error-code maps to `/404`. This could equally be `/no-page-found`:
16
17{% highlight xml %}
18    <error-page>
19        <error-code>404</error-code>
20        <location>/404</location>
21    </error-page>
22
23    <error-page>
24        <error-code>505</error-code>
25        <location>/505</location>
26    </error-page>
27{% endhighlight %}
28
29## Error Page Object
30
31Create an object that renders your visual error page. Add the URL that matches the mapping in your web.xml. 
32
33![](http://docs.brightspot.s3.amazonaws.com/error-page.png)
34
35{% highlight java %}
36@Renderer.Path("/render/common/error.jsp")
37@Renderer.LayoutPath("/render/common/page-container.jsp")
38public class ErrorPage extends Content {
39
40	private String errorMessage;
41	
42	// Getters and Setters
43}
44{% endhighlight %}
45
46</div>