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
JR Utily
2016-10-25 20:58:33 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
71c84e509f6ae92d336be63ce462d2a3962ac4c1
71c84e50
1 parent
de7eb531
rewriting rules examples !
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
141 additions
and
89 deletions
pom.xml
src/main/java/org/legrog/web/xyz/TestRootView.java
src/main/java/org/legrog/web/xyz/TestRoot.xhtml → src/main/java/org/legrog/web/xyz/TestRoute.xhtml
src/main/java/org/legrog/web/xyz/TestRouteView.java
pom.xml
View file @
71c84e5
...
...
@@ -81,18 +81,40 @@
</dependency>
<!-- Rewriting tool -->
<dependency>
<groupId>
org.ocpsoft.rewrite
</groupId>
<artifactId>
rewrite-servlet
</artifactId>
<version>
${rewrite.version}
</version>
</dependency>
<!-- Rewriting tool -->
<dependency>
<groupId>
org.ocpsoft.rewrite
</groupId>
<artifactId>
rewrite-integration-faces
</artifactId>
<version>
${rewrite.version}
</version>
</dependency>
<dependency>
<groupId>
org.ocpsoft.rewrite
</groupId>
<artifactId>
rewrite-integration-cdi
</artifactId>
<version>
${rewrite.version}
</version>
</dependency>
<!--<dependency>-->
<!--<groupId>com.ocpsoft</groupId>-->
<!--<artifactId>prettyfaces-jsf2</artifactId>-->
<!--<version>3.3.3</version>-->
<!--</dependency>-->
<!-- -->
<!--<dependency>-->
<!--<groupId>org.ocpsoft.rewrite</groupId>-->
<!--<artifactId>rewrite-config-prettyfaces</artifactId>-->
<!--<version>${rewrite.version}</version>-->
<!--</dependency> -->
<!-- **** TOOLS : LOGS + UTILS **** -->
<!-- **** TOOLS : LOGS + UTILS **** -->
<dependency>
<groupId>
org.slf4j
</groupId>
...
...
@@ -117,9 +139,54 @@
<artifactId>
spring-data-jpa
</artifactId>
</dependency>
<!-- ** Hibernate deps ** -->
<dependency>
<groupId>
antlr
</groupId>
<artifactId>
antlr
</artifactId>
</dependency>
<dependency>
<groupId>
dom4j
</groupId>
<artifactId>
dom4j
</artifactId>
</dependency>
<dependency>
<groupId>
org.hibernate.common
</groupId>
<artifactId>
hibernate-commons-annotations
</artifactId>
<version>
${hibernate-commons-annotations.version}
</version>
</dependency>
<dependency>
<groupId>
org.hibernate.javax.persistence
</groupId>
<artifactId>
hibernate-jpa-2.1-api
</artifactId>
<version>
${hibernate-jpa-2.1-api.version}
</version>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-ehcache
</artifactId>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-entitymanager
</artifactId>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-validator
</artifactId>
</dependency>
<dependency>
<groupId>
org.jboss.logging
</groupId>
<artifactId>
jboss-logging
</artifactId>
</dependency>
<dependency>
<groupId>
org.javassist
</groupId>
<artifactId>
javassist
</artifactId>
</dependency>
<!-- ** Hibernate deps ** -->
<!-- **** TEST SCOPE **** -->
<!-- **** TEST SCOPE **** -->
<dependency>
<groupId>
junit
</groupId>
...
...
@@ -188,49 +255,7 @@
<scope>test</scope>
</dependency>
-->
<!-- Hibernate -->
<dependency>
<groupId>
antlr
</groupId>
<artifactId>
antlr
</artifactId>
</dependency>
<dependency>
<groupId>
dom4j
</groupId>
<artifactId>
dom4j
</artifactId>
</dependency>
<dependency>
<groupId>
org.hibernate.common
</groupId>
<artifactId>
hibernate-commons-annotations
</artifactId>
<version>
${hibernate-commons-annotations.version}
</version>
</dependency>
<dependency>
<groupId>
org.hibernate.javax.persistence
</groupId>
<artifactId>
hibernate-jpa-2.1-api
</artifactId>
<version>
${hibernate-jpa-2.1-api.version}
</version>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-ehcache
</artifactId>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-entitymanager
</artifactId>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-validator
</artifactId>
</dependency>
<dependency>
<groupId>
org.jboss.logging
</groupId>
<artifactId>
jboss-logging
</artifactId>
</dependency>
<dependency>
<groupId>
org.javassist
</groupId>
<artifactId>
javassist
</artifactId>
</dependency>
</dependencies>
<build>
...
...
src/main/java/org/legrog/web/xyz/TestRootView.java
deleted
100644 → 0
View file @
de7eb53
package
org
.
legrog
.
web
.
xyz
;
import
javax.inject.Named
;
import
java.io.Serializable
;
@Named
@javax
.
enterprise
.
context
.
RequestScoped
//@URLMapping(id = "testroot", pattern = "/testRoot/#{bar : testRootView.bar}", viewId = "xyz/TestRoot.jsf")
public
class
TestRootView
implements
Serializable
{
String
foo
=
"my first String"
;
String
bar
=
""
;
//
// public void init() {
// if (number == null) {
// foo = "my second String";
// } else {
// foo = "my string #"+number;
// }
//
// }
public
String
getFoo
()
{
return
foo
;
}
public
void
setFoo
(
String
foo
)
{
this
.
foo
=
foo
;
}
public
String
getBar
()
{
return
bar
;
}
public
void
setBar
(
String
bar
)
{
this
.
bar
=
bar
;
}
}
src/main/java/org/legrog/web/xyz/TestRo
ot
.xhtml
→
src/main/java/org/legrog/web/xyz/TestRo
ute
.xhtml
View file @
71c84e5
...
...
@@ -10,12 +10,12 @@
</p>
<p>
And this is my string : #{testRo
ot
View.foo}
And this is my string : #{testRo
ute
View.foo}
</p>
<p>
And this is another string : #{testRo
ot
View.bar}
And this is another string : #{testRo
ute
View.bar}
</p>
</body>
...
...
src/main/java/org/legrog/web/xyz/TestRouteView.java
0 → 100644
View file @
71c84e5
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
@RequestScoped
@Join
(
path
=
"/TestRoute/{bar}"
,
to
=
"/xyz/TestRoute.jsf"
)
public
class
TestRouteView
implements
Serializable
{
String
foo
=
"my first String"
;
@Parameter
String
bar
;
@RequestAction
public
void
init
()
{
if
(
bar
==
null
)
{
foo
=
"my modified string without bar"
;
}
else
{
foo
=
"my string modified with "
+
bar
;
}
}
public
String
getFoo
()
{
return
foo
;
}
public
void
setFoo
(
String
foo
)
{
this
.
foo
=
foo
;
}
public
String
getBar
()
{
return
bar
;
}
public
void
setBar
(
String
bar
)
{
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
int
priority
()
{
return
0
;
}
}
}
Please
register
or
login
to post a comment