File tree Expand file tree Collapse file tree
core/src/main/java/com/ocpsoft/rewrite/prettyfaces
src/test/java/com/ocpsoft/pretty/faces/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727import com .ocpsoft .pretty .faces .url .QueryString ;
2828import com .ocpsoft .pretty .faces .url .URL ;
2929import com .ocpsoft .pretty .faces .util .StringUtils ;
30+ import com .ocpsoft .rewrite .EvaluationContext ;
3031import com .ocpsoft .rewrite .config .Condition ;
3132import com .ocpsoft .rewrite .config .Operation ;
3233import com .ocpsoft .rewrite .config .Rule ;
@@ -54,7 +55,7 @@ public Condition getCondition()
5455 return new HttpCondition () {
5556
5657 @ Override
57- public boolean evaluateHttp (final HttpServletRewrite event )
58+ public boolean evaluateHttp (final HttpServletRewrite event , final EvaluationContext context )
5859 {
5960 if ((event instanceof InboundRewrite )
6061 && rule .isInbound ()
@@ -74,7 +75,7 @@ public Operation getOperation()
7475 return new HttpOperation () {
7576
7677 @ Override
77- public void performHttp (final HttpServletRewrite event )
78+ public void performHttp (final HttpServletRewrite event , final EvaluationContext context )
7879 {
7980 RewriteEngine engine = new RewriteEngine ();
8081 String originalUrl = new URL (event .getRequestURL ()).decode ().toURL ()
@@ -126,6 +127,7 @@ else if (StringUtils.isNotBlank(rule.getUrl()))
126127 }
127128 }
128129 }
130+
129131 };
130132 }
131133}
Original file line number Diff line number Diff line change 2323
2424import com .ocpsoft .pretty .faces .config .rewrite .RewriteRule ;
2525import com .ocpsoft .pretty .faces .rewrite .RewriteEngine ;
26+ import com .ocpsoft .rewrite .EvaluationContext ;
2627import com .ocpsoft .rewrite .config .Condition ;
2728import com .ocpsoft .rewrite .config .Operation ;
2829import com .ocpsoft .rewrite .config .Rule ;
@@ -49,7 +50,7 @@ public Condition getCondition()
4950 return new HttpCondition () {
5051
5152 @ Override
52- public boolean evaluateHttp (final HttpServletRewrite event )
53+ public boolean evaluateHttp (final HttpServletRewrite event , final EvaluationContext context )
5354 {
5455 if ((event instanceof HttpOutboundServletRewrite )
5556 && rule .isOutbound ()
@@ -67,7 +68,7 @@ public Operation getOperation()
6768 return new HttpOperation () {
6869
6970 @ Override
70- public void performHttp (final HttpServletRewrite event )
71+ public void performHttp (final HttpServletRewrite event , final EvaluationContext context )
7172 {
7273 RewriteEngine engine = new RewriteEngine ();
7374 HttpOutboundServletRewrite outbound = (HttpOutboundServletRewrite ) event ;
Original file line number Diff line number Diff line change @@ -56,15 +56,15 @@ public Configuration getConfiguration(final ServletContext context)
5656 List <UrlMapping > mappings = config .getMappings ();
5757
5858 for (RewriteRule rule : rules ) {
59- builder .addRule (new InboundRewriteRuleAdaptor (rule ));
59+ builder .add (new InboundRewriteRuleAdaptor (rule ));
6060 }
6161
6262 for (UrlMapping mapping : mappings ) {
63- builder .addRule (new UrlMappingRuleAdaptor (mapping ));
63+ builder .add (new UrlMappingRuleAdaptor (mapping ));
6464 }
6565
6666 for (RewriteRule rule : rules ) {
67- builder .addRule (new OutboundRewriteRuleAdaptor (rule ));
67+ builder .add (new OutboundRewriteRuleAdaptor (rule ));
6868 }
6969 }
7070 return builder ;
Original file line number Diff line number Diff line change 3737import com .ocpsoft .pretty .faces .url .QueryString ;
3838import com .ocpsoft .pretty .faces .url .URL ;
3939import com .ocpsoft .pretty .faces .util .PrettyURLBuilder ;
40+ import com .ocpsoft .rewrite .EvaluationContext ;
4041import com .ocpsoft .rewrite .config .Condition ;
4142import com .ocpsoft .rewrite .config .Operation ;
4243import com .ocpsoft .rewrite .config .Rule ;
@@ -68,7 +69,7 @@ public Condition getCondition()
6869 return new HttpCondition () {
6970
7071 @ Override
71- public boolean evaluateHttp (final HttpServletRewrite event )
72+ public boolean evaluateHttp (final HttpServletRewrite event , final EvaluationContext context )
7273 {
7374 if ((event instanceof InboundRewrite )
7475 && mapping .matches (PrettyContext .getRequestURL (event .getRequest ())))
@@ -102,7 +103,7 @@ public Operation getOperation()
102103 {
103104 return new HttpOperation () {
104105 @ Override
105- public void performHttp (final HttpServletRewrite event )
106+ public void performHttp (final HttpServletRewrite event , final EvaluationContext evalContext )
106107 {
107108 PrettyContext context = PrettyContext .getCurrentInstance (event .getRequest ());
108109
Original file line number Diff line number Diff line change 5050 </repositories >
5151
5252 <dependencies >
53+ <dependency >
54+ <groupId >com.ocpsoft.rewrite</groupId >
55+ <artifactId >rewrite-impl-servlet</artifactId >
56+ <version >1.0.0-SNAPSHOT</version >
57+ </dependency >
5358 <dependency >
5459 <groupId >com.ocpsoft</groupId >
5560 <artifactId >prettyfaces-jsf2</artifactId >
Original file line number Diff line number Diff line change @@ -40,12 +40,16 @@ public class AmbiguousViewidTest extends PrettyFacesTestBase
4040 @ Deployment
4141 public static WebArchive createDeployment ()
4242 {
43- return PrettyFacesTestBase .createDeployment ()
43+ WebArchive deployment = PrettyFacesTestBase .createDeployment ()
4444 .addClass (RedirectBean .class )
4545 .addClass (PrettyNavigationHandler .class )
4646 .addClass (AmbiguousBean .class )
4747 .addResource ("basic/ambiguousViewId.xhtml" , "index.xhtml" )
4848 .addWebResource ("basic/ambiguous-pretty-config.xml" , "pretty-config.xml" );
49+
50+ System .out .println (deployment .toString (true ));
51+
52+ return deployment ;
4953 }
5054
5155 @ Test
You can’t perform that action at this time.
0 commit comments