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 21fd8714
authored
Oct 27, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hostnamefiltterin pathtrackeriä
1 parent
6228cb68
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
9 deletions
code/LanBortalWeb/WebContent/actionlog/messagelist.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/HostnameFilter.java
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_en.properties
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
code/LanBortalWeb/WebContent/actionlog/messagelist.xhtml
View file @
21fd871
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
<div
id=
"actionlog"
>
<div
id=
"actionlog"
>
<h:form
id=
"refresh"
>
<h:form
id=
"refresh"
>
<p:poll
interval=
"1"
update=
"actionlogtable"
/>
<p:poll
interval=
"1"
update=
"actionlogtable"
/>
<p:dataTable
2styleClass
="
bordertable
"
id=
"actionlogtable"
value=
"#{actionLogMessageView.messages}"
var=
"message"
paginator=
"true"
rows=
"30"
paginatorTemplate=
"{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate=
"10,20,30,50,100"
>
<p:dataTable
styleClass=
"bordertable"
id=
"actionlogtable"
value=
"#{actionLogMessageView.messages}"
var=
"message"
paginator=
"true"
rows=
"30"
paginatorTemplate=
"{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate=
"10,20,30,50,100"
>
<p:column>
<p:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.time']}"
/>
<h:outputText
value=
"#{i18n['actionlog.time']}"
/>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/HostnameFilter.java
View file @
21fd871
package
fi
.
insomnia
.
bortal
;
package
fi
.
insomnia
.
bortal
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.LinkedList
;
import
java.util.concurrent.ConcurrentLinkedQueue
;
import
java.util.Queue
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.SessionScoped
;
import
javax.faces.context.FacesContext
;
import
javax.faces.context.FacesContext
;
import
javax.servlet.Filter
;
import
javax.servlet.Filter
;
import
javax.servlet.FilterChain
;
import
javax.servlet.FilterChain
;
...
@@ -33,6 +31,7 @@ public class HostnameFilter implements Filter {
...
@@ -33,6 +31,7 @@ public class HostnameFilter implements Filter {
@EJB
@EJB
private
SessionMgmtBeanLocal
sessionmgmt
;
private
SessionMgmtBeanLocal
sessionmgmt
;
private
static
final
String
HTTP_TRAIL_NAME
=
"lanbortal_http_trail"
;
/**
/**
* Default constructor.
* Default constructor.
...
@@ -48,11 +47,11 @@ public class HostnameFilter implements Filter {
...
@@ -48,11 +47,11 @@ public class HostnameFilter implements Filter {
public
void
destroy
()
{
public
void
destroy
()
{
// Nothing...
// Nothing...
}
}
@SessionScoped
Queue
<
String
>
trail
=
new
LinkedList
<
String
>();
/**
/**
* @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)
* @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)
*/
*/
@SuppressWarnings
(
"unchecked"
)
@Override
@Override
public
void
doFilter
(
ServletRequest
request
,
ServletResponse
response
,
public
void
doFilter
(
ServletRequest
request
,
ServletResponse
response
,
FilterChain
chain
)
throws
IOException
,
ServletException
{
FilterChain
chain
)
throws
IOException
,
ServletException
{
...
@@ -117,12 +116,22 @@ public class HostnameFilter implements Filter {
...
@@ -117,12 +116,22 @@ public class HostnameFilter implements Filter {
{
{
sessionmgmt
.
updateSessionUser
(
httpRequest
.
getSession
().
getId
(),
httpRequest
.
getUserPrincipal
().
getName
());
sessionmgmt
.
updateSessionUser
(
httpRequest
.
getSession
().
getId
(),
httpRequest
.
getUserPrincipal
().
getName
());
}
}
while
(
trail
.
size
()
>=
10
)
{
trail
.
remove
();
Object
trailO
=
httpRequest
.
getSession
().
getAttribute
(
HTTP_TRAIL_NAME
);
ConcurrentLinkedQueue
<
Object
>
trail
=
null
;
if
(
trailO
!=
null
&&
trailO
instanceof
ConcurrentLinkedQueue
)
{
trail
=
(
ConcurrentLinkedQueue
<
Object
>)
trailO
;
}
else
{
trail
=
new
ConcurrentLinkedQueue
<
Object
>();
httpRequest
.
getSession
().
setAttribute
(
HTTP_TRAIL_NAME
,
trail
);
}
for
(
int
remove
=
trail
.
size
()
-
10
;
remove
>
0
;
--
remove
)
{
Object
removed
=
trail
.
poll
();
logger
.
debug
(
"Removed {} from http trail"
,
removed
);
}
}
if
(!
httpRequest
.
getRequestURI
().
matches
(
".*(resource).*"
))
{
if
(!
httpRequest
.
getRequestURI
().
matches
(
".*(resource).*"
))
{
trail
.
add
(
httpRequest
.
getRequestURI
());
trail
.
add
(
httpRequest
.
getRequestURI
());
httpRequest
.
getSession
().
setAttribute
(
"trail"
,
trail
);
}
}
}
}
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_en.properties
View file @
21fd871
...
@@ -195,6 +195,8 @@ foodWave.time = Time
...
@@ -195,6 +195,8 @@ foodWave.time = Time
foodWave.totalReserved
=
Total
foodWave.totalReserved
=
Total
foodWave.unconfirmedOrders
=
Unconfirmed
foodWave.unconfirmedOrders
=
Unconfirmed
foodadmin.editTemplate
=
Edit
foodshop.buyFromCounter
=
Pay at info
foodshop.buyFromCounter
=
Pay at info
foodshop.buyFromInternet
=
Pay at Internet
foodshop.buyFromInternet
=
Pay at Internet
...
@@ -607,6 +609,9 @@ submenu.auth.sendResetMail = Password reset
...
@@ -607,6 +609,9 @@ submenu.auth.sendResetMail = Password reset
submenu.bill.billSummary
=
Bill summary
submenu.bill.billSummary
=
Bill summary
submenu.bill.list
=
My bills
submenu.bill.list
=
My bills
submenu.bill.listAll
=
All bills
submenu.bill.listAll
=
All bills
submenu.foodadmin.createTemplate
=
Create Foodwavetemplate
submenu.foodadmin.listTemplates
=
Foodwave templates
submenu.foodmanager.listFoodwaves
=
List foodwaves
submenu.foodwave.list
=
Open foodwaves
submenu.foodwave.list
=
Open foodwaves
submenu.foodwave.listTemplates
=
Food provides
submenu.foodwave.listTemplates
=
Food provides
submenu.index
=
Frontpage
submenu.index
=
Frontpage
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
View file @
21fd871
...
@@ -193,6 +193,8 @@ foodWave.time = Aika
...
@@ -193,6 +193,8 @@ foodWave.time = Aika
foodWave.totalReserved
=
Yhteens
\u
00E4
foodWave.totalReserved
=
Yhteens
\u
00E4
foodWave.unconfirmedOrders
=
Vahvistamattomia
foodWave.unconfirmedOrders
=
Vahvistamattomia
foodadmin.editTemplate
=
Muokkaa
foodshop.buyFromCounter
=
Maksa infossa
foodshop.buyFromCounter
=
Maksa infossa
foodshop.buyFromInternet
=
Maksa Internetiss
\u
00E4
foodshop.buyFromInternet
=
Maksa Internetiss
\u
00E4
...
@@ -587,6 +589,9 @@ submenu.auth.sendResetMail = Salasanan palautus
...
@@ -587,6 +589,9 @@ submenu.auth.sendResetMail = Salasanan palautus
submenu.bill.billSummary
=
Laskujen yhteenveto
submenu.bill.billSummary
=
Laskujen yhteenveto
submenu.bill.list
=
N
\u
00E4yt
\u
00E4 omat laskut
submenu.bill.list
=
N
\u
00E4yt
\u
00E4 omat laskut
submenu.bill.listAll
=
Kaikki laskut
submenu.bill.listAll
=
Kaikki laskut
submenu.foodadmin.createTemplate
=
Luo ruokatilauspohja
submenu.foodadmin.listTemplates
=
Ruokatilauspohjat
submenu.foodmanager.listFoodwaves
=
Ruokatilaukset
submenu.foodwave.list
=
Avoimet tilaukset
submenu.foodwave.list
=
Avoimet tilaukset
submenu.index
=
Etusivu
submenu.index
=
Etusivu
submenu.map.create
=
Uusi kartta
submenu.map.create
=
Uusi kartta
...
...
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