Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 84419f03
authored
Oct 23, 2012
by
Riku Silvola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
errors
1 parent
d6e5b3f7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
0 deletions
code/LanBortalWeb/WebContent/WEB-INF/web.xml
code/LanBortalWeb/WebContent/error.xhtml
code/LanBortalWeb/WebContent/resources/media/error.jpg
code/LanBortalWeb/src/fi/insomnia/bortal/web/ErrorPageView.java
code/LanBortalWeb/WebContent/WEB-INF/web.xml
View file @
84419f0
...
@@ -27,6 +27,10 @@
...
@@ -27,6 +27,10 @@
<welcome-file>
index.jsp
</welcome-file>
<welcome-file>
index.jsp
</welcome-file>
<welcome-file>
index.wtf
</welcome-file>
<welcome-file>
index.wtf
</welcome-file>
</welcome-file-list>
</welcome-file-list>
<error-page>
<exception-type>
java.lang.Exception
</exception-type>
<location>
/error.jsf
</location>
</error-page>
<servlet>
<servlet>
<servlet-name>
Faces Servlet
</servlet-name>
<servlet-name>
Faces Servlet
</servlet-name>
<servlet-class>
javax.faces.webapp.FacesServlet
</servlet-class>
<servlet-class>
javax.faces.webapp.FacesServlet
</servlet-class>
...
...
code/LanBortalWeb/WebContent/error.xhtml
0 → 100644
View file @
84419f0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:head>
<title></title>
</h:head>
<h:body>
<center>
<img
src=
"#{request.contextPath}/resources/media/error.jpg"
/>
<h1>
LOL, ERROR!
</h1>
</center>
<c:when
test=
"#{sessionHandler.isInDevelopmentMode()}"
>
<h:outputText
escape=
"false"
value=
"#{errorPageView.stackTrace}"
/>
</c:when>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/resources/media/error.jpg
0 → 100644
View file @
84419f0
35.2 KB
code/LanBortalWeb/src/fi/insomnia/bortal/web/ErrorPageView.java
0 → 100644
View file @
84419f0
package
fi
.
insomnia
.
bortal
.
web
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.application.FacesMessage
;
import
javax.faces.context.FacesContext
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
fi.insomnia.bortal.beans.CardPrintBeanLocal
;
import
fi.insomnia.bortal.model.EventUser
;
import
fi.insomnia.bortal.web.cdiview.user.UserCartView
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.InputStream
;
import
java.io.PrintWriter
;
import
java.io.Serializable
;
import
java.io.StringWriter
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
@Named
@RequestScoped
public
class
ErrorPageView
{
String
trace
;
public
String
getStackTrace
()
{
FacesContext
context
=
FacesContext
.
getCurrentInstance
();
Map
requestMap
=
context
.
getExternalContext
().
getRequestMap
();
Throwable
ex
=
(
Throwable
)
requestMap
.
get
(
"javax.servlet.error.exception"
);
StringWriter
sw
=
new
StringWriter
();
PrintWriter
pw
=
new
PrintWriter
(
sw
);
ex
.
printStackTrace
(
pw
);
trace
=
sw
.
toString
();
return
trace
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment