Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Max Mecklin
/
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 f0c6dfe6
authored
Oct 27, 2012
by
Riku Silvola
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of codecrew.fi:bortal
2 parents
8c4cfe8f
354bd2f1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
49 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/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveFoodView.java
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
View file @
f0c6dfe
...
...
@@ -144,11 +144,16 @@
<h2>
#{i18n['foodwave.summaryView']}
</h2>
<div>
<h:outputLabel
value=
"#{i18n['foodwave.price']}: "
/>
<h:outputText
value=
"#{foodWaveView.foodwavePrice}"
/>
<h:outputText
value=
"#{foodWaveView.foodwavePrice}"
>
<f:convertNumber
minFractionDigits=
"0"
/>
</h:outputText>
</div>
<div>
<h:outputLabel
value=
"#{i18n['foodwave.foodwaveBuyInPrice']}: "
/>
<h:outputText
value=
"#{foodWaveView.foodwaveBuyInPrice}"
/>
<h:outputText
value=
"#{foodWaveView.foodwaveBuyInPrice}"
>
<f:convertNumber
minFractionDigits=
"0"
/>
</h:outputText>
</div>
<p:dataTable
var=
"summ"
value=
"#{foodWaveView.productSummaries}"
>
<p:column>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/HostnameFilter.java
View file @
f0c6dfe
...
...
@@ -31,7 +31,7 @@ public class HostnameFilter implements Filter {
@EJB
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.
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/ErrorPageView.java
View file @
f0c6dfe
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.faces.context.FacesContext
;
import
javax.inject.Inject
;
...
...
@@ -9,73 +16,63 @@ import javax.servlet.http.HttpServletRequest;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.Queue
;
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
fi.insomnia.bortal.HostnameFilter
;
@Named
@RequestScoped
public
class
ErrorPageView
implements
Serializable
{
/**
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
//
private static final long serialVersionUID = -2179309061036632342L;
//
private static final long serialVersionUID = -2179309061036632342L;
String
trace
;
@Inject
private
transient
FacesContext
context
;
@SuppressWarnings
(
"unused"
)
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ErrorPageView
.
class
);
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
;
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
;
}
public
String
getStackTraceHash
()
{
FacesContext
context
=
FacesContext
.
getCurrentInstance
();
Map
requestMap
=
context
.
getExternalContext
().
getRequestMap
();
Throwable
ex
=
(
Throwable
)
requestMap
.
get
(
"javax.servlet.error.exception"
);
CRC32
stackHash
=
new
CRC32
();
stackHash
.
update
(
ex
.
getStackTrace
().
toString
().
getBytes
());
return
"0x"
+
Long
.
toHexString
(
stackHash
.
getValue
());
FacesContext
context
=
FacesContext
.
getCurrentInstance
();
Map
requestMap
=
context
.
getExternalContext
().
getRequestMap
();
Throwable
ex
=
(
Throwable
)
requestMap
.
get
(
"javax.servlet.error.exception"
);
CRC32
stackHash
=
new
CRC32
();
stackHash
.
update
(
ex
.
getStackTrace
().
toString
().
getBytes
());
return
"0x"
+
Long
.
toHexString
(
stackHash
.
getValue
());
}
public
String
getTime
(){
public
String
getTime
()
{
String
stamp
=
"0x"
+
Long
.
toHexString
(
Calendar
.
getInstance
().
getTimeInMillis
());
logger
.
error
(
"Error occured at {} trail {}"
,
stamp
,
getTrail
());
return
stamp
;
logger
.
error
(
"Error occured at {} trail {}"
,
stamp
,
getTrail
());
return
stamp
;
}
public
String
getTrail
()
{
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
()
:
""
;
}
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveFoodView.java
View file @
f0c6dfe
...
...
@@ -141,8 +141,12 @@ public class FoodWaveFoodView extends GenericCDIView {
bill
.
addProduct
(
shopitem
.
getProduct
(),
shopitem
.
getCount
(),
getFoodWave
());
}
}
billBean
.
createBill
(
bill
);
// TODO: do this right way
eventBean
.
flushCache
();
return
bill
;
}
...
...
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