Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
8e9df330
Commit
8e9df330
authored
Mar 27, 2015
by
michael.simon
Browse files
implement own resource bundle
parent
43a1d0f8
Changes
3
Show whitespace changes
Inline
Side-by-side
bwreg-webapp/src/main/java/edu/kit/scc/webreg/res/DbMessageBundle.java
0 → 100644
View file @
8e9df330
package
edu.kit.scc.webreg.res
;
import
java.util.Collections
;
import
java.util.Enumeration
;
import
java.util.HashMap
;
import
java.util.Locale
;
import
java.util.Map
;
import
java.util.ResourceBundle
;
import
javax.faces.context.FacesContext
;
public
class
DbMessageBundle
extends
ResourceBundle
{
public
static
final
String
BASE_NAME
=
"msg.messages"
;
private
Map
<
String
,
String
>
messages
;
public
DbMessageBundle
()
{
Locale
locale
=
FacesContext
.
getCurrentInstance
().
getViewRoot
().
getLocale
();
ResourceBundle
rb
=
ResourceBundle
.
getBundle
(
BASE_NAME
,
locale
);
setParent
(
rb
);
messages
=
new
HashMap
<
String
,
String
>();
messages
.
put
(
"server_config"
,
"Server Configuration"
);
}
@Override
protected
Object
handleGetObject
(
String
key
)
{
Object
o
=
null
;
if
(
messages
!=
null
)
{
o
=
messages
.
get
(
key
);
}
if
(
o
==
null
)
{
o
=
parent
.
getObject
(
key
);
}
return
o
;
}
@Override
public
Enumeration
<
String
>
getKeys
()
{
return
messages
!=
null
?
Collections
.
enumeration
(
messages
.
keySet
())
:
parent
.
getKeys
();
}
}
bwreg-webapp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
0 → 100644
View file @
8e9df330
<?xml version="1.0" encoding="UTF-8"?>
<PROCESS
model-entity=
"JSFProcess"
/>
bwreg-webapp/src/main/webapp/WEB-INF/faces-config.xml
View file @
8e9df330
...
...
@@ -10,9 +10,8 @@
<supported-locale>
de
</supported-locale>
<supported-locale>
en
</supported-locale>
</locale-config>
<message-bundle>
msg.messages
</message-bundle>
<resource-bundle>
<base-name>
msg.messages
</base-name>
<base-name>
edu.kit.scc.webreg.res.DbMessageBundle
</base-name>
<var>
messages
</var>
</resource-bundle>
</application>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment