PageRenderTime 40ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/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
Possible License(s): GPL-2.0, AGPL-1.0
  1. ---
  2. layout: default
  3. title: Error Pages
  4. id: errorPages
  5. section: documentation
  6. ---
  7. <div markdown="1" class="span12">
  8. ## Overview
  9. This section looks at how to create and manage error pages using Brightspot.
  10. ## Error Page Element
  11. Start 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`:
  12. {% highlight xml %}
  13. <error-page>
  14. <error-code>404</error-code>
  15. <location>/404</location>
  16. </error-page>
  17. <error-page>
  18. <error-code>505</error-code>
  19. <location>/505</location>
  20. </error-page>
  21. {% endhighlight %}
  22. ## Error Page Object
  23. Create an object that renders your visual error page. Add the URL that matches the mapping in your web.xml.
  24. ![](http://docs.brightspot.s3.amazonaws.com/error-page.png)
  25. {% highlight java %}
  26. @Renderer.Path("/render/common/error.jsp")
  27. @Renderer.LayoutPath("/render/common/page-container.jsp")
  28. public class ErrorPage extends Content {
  29. private String errorMessage;
  30. // Getters and Setters
  31. }
  32. {% endhighlight %}
  33. </div>