Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
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 2d17d211
authored
Oct 27, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Errorpagea
1 parent
f4285348
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
48 deletions
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/HostnameFilter.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/ErrorPageView.java
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
View file @
2d17d21
...
@@ -144,11 +144,16 @@
...
@@ -144,11 +144,16 @@
<h2>
#{i18n['foodwave.summaryView']}
</h2>
<h2>
#{i18n['foodwave.summaryView']}
</h2>
<div>
<div>
<h:outputLabel
value=
"#{i18n['foodwave.price']}: "
/>
<h:outputLabel
value=
"#{i18n['foodwave.price']}: "
/>
<h:outputText
value=
"#{foodWaveView.foodwavePrice}"
/>
<h:outputText
value=
"#{foodWaveView.foodwavePrice}"
>
<f:convertNumber
minFractionDigits=
"0"
/>
</h:outputText>
</div>
</div>
<div>
<div>
<h:outputLabel
value=
"#{i18n['foodwave.foodwaveBuyInPrice']}: "
/>
<h:outputLabel
value=
"#{i18n['foodwave.foodwaveBuyInPrice']}: "
/>
<h:outputText
value=
"#{foodWaveView.foodwaveBuyInPrice}"
/>
<h:outputText
value=
"#{foodWaveView.foodwaveBuyInPrice}"
>
<f:convertNumber
minFractionDigits=
"0"
/>
</h:outputText>
</div>
</div>
<p:dataTable
var=
"summ"
value=
"#{foodWaveView.productSummaries}"
>
<p:dataTable
var=
"summ"
value=
"#{foodWaveView.productSummaries}"
>
<p:column>
<p:column>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/HostnameFilter.java
View file @
2d17d21
...
@@ -31,7 +31,7 @@ public class HostnameFilter implements Filter {
...
@@ -31,7 +31,7 @@ public class HostnameFilter implements Filter {
@EJB
@EJB
private
SessionMgmtBeanLocal
sessionmgmt
;
private
SessionMgmtBeanLocal
sessionmgmt
;
p
rivate
static
final
String
HTTP_TRAIL_NAME
=
"lanbortal_http_trail"
;
p
ublic
static
final
String
HTTP_TRAIL_NAME
=
"lanbortal_http_trail"
;
/**
/**
* Default constructor.
* Default constructor.
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/ErrorPageView.java
View file @
2d17d21
package
fi
.
insomnia
.
bortal
.
web
;
package
fi
.
insomnia
.
bortal
.
web
;
import
java.io.PrintWriter
;
import
java.io.Serializable
;
import
java.io.StringWriter
;
import
java.util.Calendar
;
import
java.util.Map
;
import
java.util.zip.CRC32
;
import
javax.enterprise.context.RequestScoped
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.context.FacesContext
;
import
javax.faces.context.FacesContext
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
...
@@ -9,73 +16,63 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -9,73 +16,63 @@ import javax.servlet.http.HttpServletRequest;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
java.util.Queue
;
import
fi.insomnia.bortal.HostnameFilter
;
import
java.io.PrintWriter
;
import
java.io.Serializable
;
import
java.io.StringWriter
;
import
java.util.Calendar
;
import
java.util.Map
;
import
java.util.zip.CRC32
;
@Named
@Named
@RequestScoped
@RequestScoped
public
class
ErrorPageView
implements
Serializable
{
public
class
ErrorPageView
implements
Serializable
{
/**
/**
*
*
*/
*/
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
//
private static final long serialVersionUID = -2179309061036632342L;
//
private static final long serialVersionUID = -2179309061036632342L;
String
trace
;
String
trace
;
@Inject
@Inject
private
transient
FacesContext
context
;
private
transient
FacesContext
context
;
@SuppressWarnings
(
"unused"
)
@SuppressWarnings
(
"unused"
)
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ErrorPageView
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ErrorPageView
.
class
);
public
String
getStackTrace
()
{
public
String
getStackTrace
()
{
FacesContext
context
=
FacesContext
.
getCurrentInstance
();
FacesContext
context
=
FacesContext
.
getCurrentInstance
();
Map
requestMap
=
context
.
getExternalContext
().
getRequestMap
();
Map
requestMap
=
context
.
getExternalContext
().
getRequestMap
();
Throwable
ex
=
Throwable
ex
=
(
Throwable
)
requestMap
.
get
(
"javax.servlet.error.exception"
);
(
Throwable
)
requestMap
.
get
(
"javax.servlet.error.exception"
);
StringWriter
sw
=
new
StringWriter
();
StringWriter
sw
=
new
StringWriter
();
PrintWriter
pw
=
new
PrintWriter
(
sw
);
PrintWriter
pw
=
new
PrintWriter
(
sw
);
ex
.
printStackTrace
(
pw
);
ex
.
printStackTrace
(
pw
);
trace
=
sw
.
toString
();
trace
=
sw
.
toString
();
return
trace
;
return
trace
;
}
}
public
String
getStackTraceHash
()
{
public
String
getStackTraceHash
()
{
FacesContext
context
=
FacesContext
.
getCurrentInstance
();
FacesContext
context
=
FacesContext
.
getCurrentInstance
();
Map
requestMap
=
context
.
getExternalContext
().
getRequestMap
();
Map
requestMap
=
context
.
getExternalContext
().
getRequestMap
();
Throwable
ex
=
Throwable
ex
=
(
Throwable
)
requestMap
.
get
(
"javax.servlet.error.exception"
);
(
Throwable
)
requestMap
.
get
(
"javax.servlet.error.exception"
);
CRC32
stackHash
=
new
CRC32
();
CRC32
stackHash
=
new
CRC32
();
stackHash
.
update
(
ex
.
getStackTrace
().
toString
().
getBytes
());
stackHash
.
update
(
ex
.
getStackTrace
().
toString
().
getBytes
());
return
"0x"
+
Long
.
toHexString
(
stackHash
.
getValue
());
return
"0x"
+
Long
.
toHexString
(
stackHash
.
getValue
());
}
}
public
String
getTime
(){
public
String
getTime
()
{
String
stamp
=
"0x"
+
Long
.
toHexString
(
Calendar
.
getInstance
().
getTimeInMillis
());
String
stamp
=
"0x"
+
Long
.
toHexString
(
Calendar
.
getInstance
().
getTimeInMillis
());
logger
.
error
(
"Error occured at {} trail {}"
,
stamp
,
getTrail
());
logger
.
error
(
"Error occured at {} trail {}"
,
stamp
,
getTrail
());
return
stamp
;
return
stamp
;
}
}
public
String
getTrail
()
{
public
String
getTrail
()
{
HttpServletRequest
req
=
(
HttpServletRequest
)
getContext
().
getExternalContext
().
getRequest
();
HttpServletRequest
req
=
(
HttpServletRequest
)
getContext
().
getExternalContext
().
getRequest
();
Object
trail
=
req
.
getSession
().
getAttribute
(
"trail"
);
Object
trail
=
req
.
getSession
().
getAttribute
(
HostnameFilter
.
HTTP_TRAIL_NAME
);
return
trail
!=
null
?
trail
.
toString
()
:
""
;
return
trail
!=
null
?
trail
.
toString
()
:
""
;
}
}
...
...
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