Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Francois Leveque
2017-02-15 15:33:02 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4030dad80c0df4a6b411601174bf7ebef55f94a3
4030dad8
1 parent
69b089c3
Enrichissement exemple et suppression configuration locale.
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
19 deletions
src/main/java/org/legrog/web/xyz/TestRoute.xhtml
src/main/java/org/legrog/web/xyz/TestRouteView.java
src/main/java/org/legrog/web/xyz/TestRoute.xhtml
View file @
4030dad
...
...
@@ -18,4 +18,7 @@ And this is my string : #{testRouteView.foo}
And this is another string : #{testRouteView.bar}
</p>
<p>
And a new information : ${testRouteView.tar}
</p>
</body>
...
...
src/main/java/org/legrog/web/xyz/TestRouteView.java
View file @
4030dad
...
...
@@ -3,15 +3,8 @@ package org.legrog.web.xyz;
import
org.ocpsoft.rewrite.annotation.Join
;
import
org.ocpsoft.rewrite.annotation.Parameter
;
import
org.ocpsoft.rewrite.annotation.RequestAction
;
import
org.ocpsoft.rewrite.annotation.RewriteConfiguration
;
import
org.ocpsoft.rewrite.config.Configuration
;
import
org.ocpsoft.rewrite.config.ConfigurationBuilder
;
import
org.ocpsoft.rewrite.el.El
;
import
org.ocpsoft.rewrite.servlet.config.HttpConfigurationProvider
;
import
javax.enterprise.context.RequestScoped
;
import
javax.inject.Named
;
import
javax.servlet.ServletContext
;
import
java.io.Serializable
;
@Named
...
...
@@ -20,6 +13,7 @@ import java.io.Serializable;
public
class
TestRouteView
implements
Serializable
{
String
foo
=
"my first String"
;
String
tar
=
"It's a pit!"
;
@Parameter
String
bar
;
...
...
@@ -30,6 +24,13 @@ public class TestRouteView implements Serializable {
foo
=
"my modified string without bar"
;
}
else
{
foo
=
"my string modified with "
+
bar
;
try
{
Integer
barnum
=
new
Integer
(
bar
);
tar
=
"The value converts into an integer "
+
barnum
;
}
catch
(
NumberFormatException
ne
)
{
tar
=
"The value "
+
bar
+
" doesn't convert into an integer"
;
}
}
}
...
...
@@ -50,18 +51,11 @@ public class TestRouteView implements Serializable {
this
.
bar
=
bar
;
}
@RewriteConfiguration
public
static
class
RewriteConfig
extends
HttpConfigurationProvider
{
public
Configuration
getConfiguration
(
ServletContext
context
)
{
return
ConfigurationBuilder
.
begin
()
.
addRule
(
org
.
ocpsoft
.
rewrite
.
servlet
.
config
.
rule
.
Join
.
path
(
"/TestRoute2/{bar}"
).
to
(
"/xyz/TestRoute.jsf"
))
.
where
(
"bar"
).
bindsTo
(
El
.
property
(
"testRouteView.bar"
))
;
}
public
String
getTar
()
{
return
tar
;
}
public
int
priority
()
{
return
0
;
}
public
void
setTar
(
String
tar
)
{
this
.
tar
=
tar
;
}
}
...
...
Please
register
or
login
to post a comment