Tuckey rewrite rule to servlet in /app doens't work , bug?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Tuckey rewrite rule to servlet in /app doens't work , bug?

dilekciy
Hi,

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

I've created an example plugin which demonstrates this weird behavior.

You can find this plugin here: https://github.com/yasindilekci/com.dotcms.tuckey-servlet

Steps to reproduce:
1. Clone repo
2. Build the plugin with gradlew.jar bat (windows)
3. Upload to your dotCMS instance

Visit the page to check if the Hello World Servlet is registered - should be ok
http://demo.dotcms.com/app/helloworld

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!
Rule created with addRewriteRule() method
http://demo.dotcms.com/foo/bar/servlet-test

Rule created with NormalRule class, won't work either
http://demo.dotcms.com/foo/bar/2servlet-test

Now use Tuckey rewrite rule to forward to a file (image), this works...
http://demo.dotcms.com/foo/bar/image-forward

Can someone please check why this is happenings?

Thanks.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/33bcf32f-c9bd-4ad0-8ecd-cd28286cd7ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

wezell1
I think there is a servlet mapped to /app in the default dotCMS web.xml.  You will probably need to remove that. 

On Fri, Jun 23, 2017 at 11:40 AM, <[hidden email]> wrote:
Hi,

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

I've created an example plugin which demonstrates this weird behavior.


Steps to reproduce:
1. Clone repo
2. Build the plugin with gradlew.jar bat (windows)
3. Upload to your dotCMS instance

Visit the page to check if the Hello World Servlet is registered - should be ok

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!
Rule created with addRewriteRule() method

Rule created with NormalRule class, won't work either

Now use Tuckey rewrite rule to forward to a file (image), this works...

Can someone please check why this is happenings?

Thanks.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/33bcf32f-c9bd-4ad0-8ecd-cd28286cd7ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--






3059 Grand Avenue
Suite 410-B
Miami FL 33133
Main: 
305-900-2001 | Direct: 978.294.9429

   

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAPL0VyHEr7o%2BmW4jfA%2BxRTekJ%3D%3DDmhaYGp%2B3qmERsB-S5MZx8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

Maarten Daalder
Hi Will,

But wouldn't that not be the Apache Felix servlet (that is bound to /app/*)?

The intention is to forward the request to a servlet that is added by the Dynamic Plugin.

With kind regards,
Maarten Daalder
ISAAC

On Friday, 23 June 2017 17:43:20 UTC+2, Will Ezell wrote:
I think there is a servlet mapped to /app in the default dotCMS web.xml.  You will probably need to remove that. 

On Fri, Jun 23, 2017 at 11:40 AM, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="1rZeaTLbAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">dile...@...> wrote:
Hi,

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

I've created an example plugin which demonstrates this weird behavior.

You can find this plugin here: <a href="https://github.com/yasindilekci/com.dotcms.tuckey-servlet" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fyasindilekci%2Fcom.dotcms.tuckey-servlet\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEMxYwEOaXS3tcBW54g-6Qs5VcC2A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fyasindilekci%2Fcom.dotcms.tuckey-servlet\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEMxYwEOaXS3tcBW54g-6Qs5VcC2A&#39;;return true;">https://github.com/yasindilekci/com.dotcms.tuckey-servlet

Steps to reproduce:
1. Clone repo
2. Build the plugin with gradlew.jar bat (windows)
3. Upload to your dotCMS instance

Visit the page to check if the Hello World Servlet is registered - should be ok
<a href="http://demo.dotcms.com/app/helloworld" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Fapp%2Fhelloworld\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELS4-qVesRXRCQzCN6zLA8PWLXaA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Fapp%2Fhelloworld\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELS4-qVesRXRCQzCN6zLA8PWLXaA&#39;;return true;">http://demo.dotcms.com/app/helloworld

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!
Rule created with addRewriteRule() method
<a href="http://demo.dotcms.com/foo/bar/servlet-test" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fservlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUgxMQocKb8iRE8NaE0NpioneL7w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fservlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUgxMQocKb8iRE8NaE0NpioneL7w&#39;;return true;">http://demo.dotcms.com/foo/bar/servlet-test

Rule created with NormalRule class, won't work either
<a href="http://demo.dotcms.com/foo/bar/2servlet-test" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2F2servlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLk-lKyoD_n8uz0ZX-4k9KsHvUJA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2F2servlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLk-lKyoD_n8uz0ZX-4k9KsHvUJA&#39;;return true;">http://demo.dotcms.com/foo/bar/2servlet-test

Now use Tuckey rewrite rule to forward to a file (image), this works...
<a href="http://demo.dotcms.com/foo/bar/image-forward" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fimage-forward\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF2JzqEKDrz5iLDHorpDEvtfHJTAQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fimage-forward\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF2JzqEKDrz5iLDHorpDEvtfHJTAQ&#39;;return true;">http://demo.dotcms.com/foo/bar/image-forward

Can someone please check why this is happenings?

Thanks.

--
<a href="http://dotcms.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdotcms.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGFT4ej1MQxQ2vu3iAUqYQgS59efw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdotcms.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGFT4ej1MQxQ2vu3iAUqYQgS59efw&#39;;return true;">http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="1rZeaTLbAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">dotcms+un...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="1rZeaTLbAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">dot...@....
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/dotcms/33bcf32f-c9bd-4ad0-8ecd-cd28286cd7ec%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/dotcms/33bcf32f-c9bd-4ad0-8ecd-cd28286cd7ec%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/dotcms/33bcf32f-c9bd-4ad0-8ecd-cd28286cd7ec%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/dotcms/33bcf32f-c9bd-4ad0-8ecd-cd28286cd7ec%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--






3059 Grand Avenue
Suite 410-B
Miami FL 33133
Main: 
305-900-2001 | Direct: 978.294.9429

<a href="javascript:" target="_blank" gdf-obfuscated-mailto="1rZeaTLbAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">wi...@... | <a href="http://www.dotcms.com/" style="color:rgb(17,85,204)" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.dotcms.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFNWs9V2WKwZWrVfr8NIkv4s5e0Dw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.dotcms.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFNWs9V2WKwZWrVfr8NIkv4s5e0Dw&#39;;return true;">dotcms.com

<a href="https://twitter.com/dotcms" style="color:rgb(17,85,204)" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Ftwitter.com%2Fdotcms\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFI7UKimTeQqANitfHPRcF_RMkrTw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Ftwitter.com%2Fdotcms\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFI7UKimTeQqANitfHPRcF_RMkrTw&#39;;return true;"> <a href="http://www.linkedin.com/company/dotcms" style="color:rgb(17,85,204)" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fdotcms\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_qDpNIBt3bgBzCOdMhHi9AfMwNA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fdotcms\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_qDpNIBt3bgBzCOdMhHi9AfMwNA&#39;;return true;"> <a href="https://plus.google.com/+Dotcms" style="color:rgb(17,85,204)" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://plus.google.com/+Dotcms&#39;;return true;" onclick="this.href=&#39;https://plus.google.com/+Dotcms&#39;;return true;"> <a href="https://www.facebook.com/dotCMS" style="color:rgb(17,85,204);font-family:verdana,sans-serif;font-size:x-small" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.facebook.com%2FdotCMS\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF-Ge1oKMS8PGManhW1ZhuhY8-L9g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.facebook.com%2FdotCMS\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF-Ge1oKMS8PGManhW1ZhuhY8-L9g&#39;;return true;">

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/e2fdf7d4-0f66-498a-8e2d-448976f9bfd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

Jason Tesser-2
is it a redirect or forward 

On Fri, Jun 23, 2017 at 11:46 AM Maarten Daalder <[hidden email]> wrote:
Hi Will,

But wouldn't that not be the Apache Felix servlet (that is bound to /app/*)?

The intention is to forward the request to a servlet that is added by the Dynamic Plugin.

With kind regards,
Maarten Daalder
ISAAC


On Friday, 23 June 2017 17:43:20 UTC+2, Will Ezell wrote:
I think there is a servlet mapped to /app in the default dotCMS web.xml.  You will probably need to remove that. 
On Fri, Jun 23, 2017 at 11:40 AM, <[hidden email]> wrote:
Hi,

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

I've created an example plugin which demonstrates this weird behavior.


Steps to reproduce:
1. Clone repo
2. Build the plugin with gradlew.jar bat (windows)
3. Upload to your dotCMS instance

Visit the page to check if the Hello World Servlet is registered - should be ok

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!
Rule created with addRewriteRule() method

Rule created with NormalRule class, won't work either

Now use Tuckey rewrite rule to forward to a file (image), this works...

Can someone please check why this is happenings?

Thanks.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].



--






3059 Grand Avenue
Suite 410-B
Miami FL 33133
Main: 
305-900-2001 | Direct: 978.294.9429

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/e2fdf7d4-0f66-498a-8e2d-448976f9bfd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CALDe1GNqj4d2%2B%2B1JPg%2BooheLfXb%3D2wHmi1cSdMX-0oBW_uBztg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

Maarten Daalder
We would want this to be a forward to prevent an extra request for CSS/JS.

On Friday, 23 June 2017 17:53:31 UTC+2, LORDs_diakonos wrote:
is it a redirect or forward 

On Fri, Jun 23, 2017 at 11:46 AM Maarten Daalder <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="C3aIt8DbAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">maarten...@...> wrote:
Hi Will,

But wouldn't that not be the Apache Felix servlet (that is bound to /app/*)?

The intention is to forward the request to a servlet that is added by the Dynamic Plugin.

With kind regards,
Maarten Daalder
ISAAC


On Friday, 23 June 2017 17:43:20 UTC+2, Will Ezell wrote:
I think there is a servlet mapped to /app in the default dotCMS web.xml.  You will probably need to remove that. 
On Fri, Jun 23, 2017 at 11:40 AM, <[hidden email]> wrote:
Hi,

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

I've created an example plugin which demonstrates this weird behavior.

You can find this plugin here: <a href="https://github.com/yasindilekci/com.dotcms.tuckey-servlet" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fyasindilekci%2Fcom.dotcms.tuckey-servlet\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEMxYwEOaXS3tcBW54g-6Qs5VcC2A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fyasindilekci%2Fcom.dotcms.tuckey-servlet\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEMxYwEOaXS3tcBW54g-6Qs5VcC2A&#39;;return true;">https://github.com/yasindilekci/com.dotcms.tuckey-servlet

Steps to reproduce:
1. Clone repo
2. Build the plugin with gradlew.jar bat (windows)
3. Upload to your dotCMS instance

Visit the page to check if the Hello World Servlet is registered - should be ok
<a href="http://demo.dotcms.com/app/helloworld" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Fapp%2Fhelloworld\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELS4-qVesRXRCQzCN6zLA8PWLXaA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Fapp%2Fhelloworld\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELS4-qVesRXRCQzCN6zLA8PWLXaA&#39;;return true;">http://demo.dotcms.com/app/helloworld

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!
Rule created with addRewriteRule() method
<a href="http://demo.dotcms.com/foo/bar/servlet-test" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fservlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUgxMQocKb8iRE8NaE0NpioneL7w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fservlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUgxMQocKb8iRE8NaE0NpioneL7w&#39;;return true;">http://demo.dotcms.com/foo/bar/servlet-test

Rule created with NormalRule class, won't work either
<a href="http://demo.dotcms.com/foo/bar/2servlet-test" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2F2servlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLk-lKyoD_n8uz0ZX-4k9KsHvUJA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2F2servlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLk-lKyoD_n8uz0ZX-4k9KsHvUJA&#39;;return true;">http://demo.dotcms.com/foo/bar/2servlet-test

Now use Tuckey rewrite rule to forward to a file (image), this works...
<a href="http://demo.dotcms.com/foo/bar/image-forward" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fimage-forward\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF2JzqEKDrz5iLDHorpDEvtfHJTAQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fimage-forward\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF2JzqEKDrz5iLDHorpDEvtfHJTAQ&#39;;return true;">http://demo.dotcms.com/foo/bar/image-forward

Can someone please check why this is happenings?

Thanks.

--
<a href="http://dotcms.com" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdotcms.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGFT4ej1MQxQ2vu3iAUqYQgS59efw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdotcms.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGFT4ej1MQxQ2vu3iAUqYQgS59efw&#39;;return true;">http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/dotcms/33bcf32f-c9bd-4ad0-8ecd-cd28286cd7ec%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/dotcms/33bcf32f-c9bd-4ad0-8ecd-cd28286cd7ec%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/dotcms/33bcf32f-c9bd-4ad0-8ecd-cd28286cd7ec%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/dotcms/33bcf32f-c9bd-4ad0-8ecd-cd28286cd7ec%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--






3059 Grand Avenue
Suite 410-B
Miami FL 33133
Main: 
305-900-2001 | Direct: 978.294.9429

[hidden email] | <a href="http://www.dotcms.com/" style="color:rgb(17,85,204)" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.dotcms.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFNWs9V2WKwZWrVfr8NIkv4s5e0Dw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.dotcms.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFNWs9V2WKwZWrVfr8NIkv4s5e0Dw&#39;;return true;">dotcms.com

<a href="https://twitter.com/dotcms" style="color:rgb(17,85,204)" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Ftwitter.com%2Fdotcms\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFI7UKimTeQqANitfHPRcF_RMkrTw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Ftwitter.com%2Fdotcms\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFI7UKimTeQqANitfHPRcF_RMkrTw&#39;;return true;"> <a href="http://www.linkedin.com/company/dotcms" style="color:rgb(17,85,204)" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fdotcms\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_qDpNIBt3bgBzCOdMhHi9AfMwNA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fdotcms\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_qDpNIBt3bgBzCOdMhHi9AfMwNA&#39;;return true;"> <a href="https://plus.google.com/+Dotcms" style="color:rgb(17,85,204)" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://plus.google.com/+Dotcms&#39;;return true;" onclick="this.href=&#39;https://plus.google.com/+Dotcms&#39;;return true;"> <a href="https://www.facebook.com/dotCMS" style="color:rgb(17,85,204);font-family:verdana,sans-serif;font-size:x-small" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.facebook.com%2FdotCMS\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF-Ge1oKMS8PGManhW1ZhuhY8-L9g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.facebook.com%2FdotCMS\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF-Ge1oKMS8PGManhW1ZhuhY8-L9g&#39;;return true;">

--
<a href="http://dotcms.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdotcms.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGFT4ej1MQxQ2vu3iAUqYQgS59efw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdotcms.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGFT4ej1MQxQ2vu3iAUqYQgS59efw&#39;;return true;">http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="C3aIt8DbAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">dotcms+un...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="C3aIt8DbAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">dot...@....
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/dotcms/e2fdf7d4-0f66-498a-8e2d-448976f9bfd6%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/dotcms/e2fdf7d4-0f66-498a-8e2d-448976f9bfd6%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/dotcms/e2fdf7d4-0f66-498a-8e2d-448976f9bfd6%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/dotcms/e2fdf7d4-0f66-498a-8e2d-448976f9bfd6%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/fe2549c7-6ce1-486a-8dff-22b76e52bbbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

dilekciy
In reply to this post by dilekciy
Hi,

Is there any update on this?

Thank you.

Op vrijdag 23 juni 2017 17:40:10 UTC+2 schreef [hidden email]:
Hi,

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

I've created an example plugin which demonstrates this weird behavior.

You can find this plugin here: <a href="https://github.com/yasindilekci/com.dotcms.tuckey-servlet" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fyasindilekci%2Fcom.dotcms.tuckey-servlet\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEMxYwEOaXS3tcBW54g-6Qs5VcC2A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fyasindilekci%2Fcom.dotcms.tuckey-servlet\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEMxYwEOaXS3tcBW54g-6Qs5VcC2A&#39;;return true;">https://github.com/yasindilekci/com.dotcms.tuckey-servlet

Steps to reproduce:
1. Clone repo
2. Build the plugin with gradlew.jar bat (windows)
3. Upload to your dotCMS instance

Visit the page to check if the Hello World Servlet is registered - should be ok
<a href="http://demo.dotcms.com/app/helloworld" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Fapp%2Fhelloworld\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELS4-qVesRXRCQzCN6zLA8PWLXaA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Fapp%2Fhelloworld\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELS4-qVesRXRCQzCN6zLA8PWLXaA&#39;;return true;">http://demo.dotcms.com/app/helloworld

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!
Rule created with addRewriteRule() method
<a href="http://demo.dotcms.com/foo/bar/servlet-test" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fservlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUgxMQocKb8iRE8NaE0NpioneL7w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fservlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUgxMQocKb8iRE8NaE0NpioneL7w&#39;;return true;">http://demo.dotcms.com/foo/bar/servlet-test

Rule created with NormalRule class, won't work either
<a href="http://demo.dotcms.com/foo/bar/2servlet-test" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2F2servlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLk-lKyoD_n8uz0ZX-4k9KsHvUJA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2F2servlet-test\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLk-lKyoD_n8uz0ZX-4k9KsHvUJA&#39;;return true;">http://demo.dotcms.com/foo/bar/2servlet-test

Now use Tuckey rewrite rule to forward to a file (image), this works...
<a href="http://demo.dotcms.com/foo/bar/image-forward" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fimage-forward\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF2JzqEKDrz5iLDHorpDEvtfHJTAQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdemo.dotcms.com%2Ffoo%2Fbar%2Fimage-forward\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF2JzqEKDrz5iLDHorpDEvtfHJTAQ&#39;;return true;">http://demo.dotcms.com/foo/bar/image-forward

Can someone please check why this is happenings?

Thanks.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b86190bc-31d5-4a26-84f0-d7e8d822669e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

Nathan Keiter

We have been able to use Tuckey rewrite rules to override servlets in the /app/ folder in all latest versions. 2.5.4, 3.5.1, 4.0.1.

 

There is likely something wrong with your plugin.

 

Keep in mind after the rewrite, the original URL won’t work anymore.

 

So if your servlet is registered at “/app/funstuff”, “/app/funstuff” won’t work after mapping it to “/funstuff”.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Monday, August 21, 2017 3:44 AM
To: dotCMS User Group
Subject: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

 

Hi,

 

Is there any update on this?

 

Thank you.

Op vrijdag 23 juni 2017 17:40:10 UTC+2 schreef [hidden email]:

Hi,

 

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

 

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

 

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

 

I've created an example plugin which demonstrates this weird behavior.

 

 

Steps to reproduce:

1. Clone repo

2. Build the plugin with gradlew.jar bat (windows)

3. Upload to your dotCMS instance

 

Visit the page to check if the Hello World Servlet is registered - should be ok

 

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!

Rule created with addRewriteRule() method

 

Rule created with NormalRule class, won't work either

 

Now use Tuckey rewrite rule to forward to a file (image), this works...

 

Can someone please check why this is happenings?


Thanks.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b86190bc-31d5-4a26-84f0-d7e8d822669e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/c98980c1c68a4f84a55a2c7821730598%40exch13b.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

dotCMS Users Group mailing list
This has been an issue since about version 3.6, any rule with the to type of "forward" does not work.


For example one of our rules for our blog was:

        addRewriteRule("^/blog/([A-Za-z0-9\\-]+)/?$", "/blog/post.htm?urlTitle=$1", "forward", "ContentStreamURLMap");

This is the workaround we were given:

        NormalRule rule = new NormalRule();
        rule.setName("ContentStreamURLMap");
        rule.setFrom("^/blog/([A-Za-z0-9\\-]+)/?$");
        SetAttribute cmsFilterUrlMapOverrideAttribute = new SetAttribute();
        cmsFilterUrlMapOverrideAttribute.setName("CMS_FILTER_URLMAP_OVERRIDE");
        cmsFilterUrlMapOverrideAttribute.setValue("/blog/post.htm?urlTitle=$1");
        rule.addSetAttribute(cmsFilterUrlMapOverrideAttribute);
        addRewriteRule(rule);

Which does the trick, but obviously, would like forwards to work properly instead of having to pass them through the CMS filter like this.

On Mon, Aug 21, 2017 at 8:50 AM Nathan Keiter <[hidden email]> wrote:

We have been able to use Tuckey rewrite rules to override servlets in the /app/ folder in all latest versions. 2.5.4, 3.5.1, 4.0.1.

 

There is likely something wrong with your plugin.

 

Keep in mind after the rewrite, the original URL won’t work anymore.

 

So if your servlet is registered at “/app/funstuff”, “/app/funstuff” won’t work after mapping it to “/funstuff”.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: <a href="tel:(717)%20337-6993" value="+17173376993" target="_blank">717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Monday, August 21, 2017 3:44 AM
To: dotCMS User Group
Subject: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

 

Hi,

 

Is there any update on this?

 

Thank you.

Op vrijdag 23 juni 2017 17:40:10 UTC+2 schreef [hidden email]:

Hi,

 

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

 

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

 

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

 

I've created an example plugin which demonstrates this weird behavior.

 

 

Steps to reproduce:

1. Clone repo

2. Build the plugin with gradlew.jar bat (windows)

3. Upload to your dotCMS instance

 

Visit the page to check if the Hello World Servlet is registered - should be ok

 

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!

Rule created with addRewriteRule() method

 

Rule created with NormalRule class, won't work either

 

Now use Tuckey rewrite rule to forward to a file (image), this works...

 

Can someone please check why this is happenings?


Thanks.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b86190bc-31d5-4a26-84f0-d7e8d822669e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/c98980c1c68a4f84a55a2c7821730598%40exch13b.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAMAbHgXaszYstE6oEf7GCyzhOBYrxdMm83MEPr9JQ%3Djok3evuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

wezell1
Good news is that in the upcoming version of dotCMS, Vanity URLs are going to become content and respect regex based rewrite rules.  I can confirm that in the latest master this works:


Inline image 1


On Mon, Aug 21, 2017 at 9:54 AM, 'Chris Falzone' via dotCMS User Group <[hidden email]> wrote:
This has been an issue since about version 3.6, any rule with the to type of "forward" does not work.


For example one of our rules for our blog was:

        addRewriteRule("^/blog/([A-Za-z0-9\\-]+)/?$", "/blog/post.htm?urlTitle=$1", "forward", "ContentStreamURLMap");

This is the workaround we were given:

        NormalRule rule = new NormalRule();
        rule.setName("ContentStreamURLMap");
        rule.setFrom("^/blog/([A-Za-z0-9\\-]+)/?$");
        SetAttribute cmsFilterUrlMapOverrideAttribute = new SetAttribute();
        cmsFilterUrlMapOverrideAttribute.setName("CMS_FILTER_URLMAP_OVERRIDE");
        cmsFilterUrlMapOverrideAttribute.setValue("/blog/post.htm?urlTitle=$1");
        rule.addSetAttribute(cmsFilterUrlMapOverrideAttribute);
        addRewriteRule(rule);

Which does the trick, but obviously, would like forwards to work properly instead of having to pass them through the CMS filter like this.

On Mon, Aug 21, 2017 at 8:50 AM Nathan Keiter <[hidden email]> wrote:

We have been able to use Tuckey rewrite rules to override servlets in the /app/ folder in all latest versions. 2.5.4, 3.5.1, 4.0.1.

 

There is likely something wrong with your plugin.

 

Keep in mind after the rewrite, the original URL won’t work anymore.

 

So if your servlet is registered at “/app/funstuff”, “/app/funstuff” won’t work after mapping it to “/funstuff”.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: <a href="tel:(717)%20337-6993" value="+17173376993" target="_blank">717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Monday, August 21, 2017 3:44 AM
To: dotCMS User Group
Subject: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

 

Hi,

 

Is there any update on this?

 

Thank you.

Op vrijdag 23 juni 2017 17:40:10 UTC+2 schreef [hidden email]:

Hi,

 

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

 

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

 

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

 

I've created an example plugin which demonstrates this weird behavior.

 

 

Steps to reproduce:

1. Clone repo

2. Build the plugin with gradlew.jar bat (windows)

3. Upload to your dotCMS instance

 

Visit the page to check if the Hello World Servlet is registered - should be ok

 

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!

Rule created with addRewriteRule() method

 

Rule created with NormalRule class, won't work either

 

Now use Tuckey rewrite rule to forward to a file (image), this works...

 

Can someone please check why this is happenings?


Thanks.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b86190bc-31d5-4a26-84f0-d7e8d822669e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/c98980c1c68a4f84a55a2c7821730598%40exch13b.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAMAbHgXaszYstE6oEf7GCyzhOBYrxdMm83MEPr9JQ%3Djok3evuw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--






3059 Grand Avenue
Suite 410-B
Miami FL 33133
Main: 
305-900-2001 | Direct: 978.294.9429

   

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAPL0VyF2vXKC3zzEStFSm9EQT12MBSq0_OHL2ZXFUuqmgdA8OA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

Nathan Keiter
In reply to this post by dotCMS Users Group mailing list

All of ours are type “forward” and they all work in the versions listed. (We have nearly 2 dozen.)

 

We’ve never had any environments on 3.6 however, but I can confirm it works in 4.0.1.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: 'Chris Falzone' via dotCMS User Group [mailto:[hidden email]]
Sent: Monday, August 21, 2017 9:54 AM
To: [hidden email]
Subject: Re: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

 

This has been an issue since about version 3.6, any rule with the to type of "forward" does not work.

 

 

For example one of our rules for our blog was:

 

        addRewriteRule("^/blog/([A-Za-z0-9\\-]+)/?$", "/blog/post.htm?urlTitle=$1", "forward", "ContentStreamURLMap");

 

This is the workaround we were given:

 

        NormalRule rule = new NormalRule();

        rule.setName("ContentStreamURLMap");

        rule.setFrom("^/blog/([A-Za-z0-9\\-]+)/?$");

        SetAttribute cmsFilterUrlMapOverrideAttribute = new SetAttribute();

        cmsFilterUrlMapOverrideAttribute.setName("CMS_FILTER_URLMAP_OVERRIDE");

        cmsFilterUrlMapOverrideAttribute.setValue("/blog/post.htm?urlTitle=$1");

        rule.addSetAttribute(cmsFilterUrlMapOverrideAttribute);

        addRewriteRule(rule);

 

Which does the trick, but obviously, would like forwards to work properly instead of having to pass them through the CMS filter like this.

 

On Mon, Aug 21, 2017 at 8:50 AM Nathan Keiter <[hidden email]> wrote:

We have been able to use Tuckey rewrite rules to override servlets in the /app/ folder in all latest versions. 2.5.4, 3.5.1, 4.0.1.

 

There is likely something wrong with your plugin.

 

Keep in mind after the rewrite, the original URL won’t work anymore.

 

So if your servlet is registered at “/app/funstuff”, “/app/funstuff” won’t work after mapping it to “/funstuff”.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: <a href="tel:(717)%20337-6993" target="_blank"> 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Monday, August 21, 2017 3:44 AM
To: dotCMS User Group
Subject: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

 

Hi,

 

Is there any update on this?

 

Thank you.

Op vrijdag 23 juni 2017 17:40:10 UTC+2 schreef [hidden email]:

Hi,

 

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

 

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

 

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

 

I've created an example plugin which demonstrates this weird behavior.

 

 

Steps to reproduce:

1. Clone repo

2. Build the plugin with gradlew.jar bat (windows)

3. Upload to your dotCMS instance

 

Visit the page to check if the Hello World Servlet is registered - should be ok

 

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!

Rule created with addRewriteRule() method

 

Rule created with NormalRule class, won't work either

 

Now use Tuckey rewrite rule to forward to a file (image), this works...

 

Can someone please check why this is happenings?


Thanks.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b86190bc-31d5-4a26-84f0-d7e8d822669e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/c98980c1c68a4f84a55a2c7821730598%40exch13b.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAMAbHgXaszYstE6oEf7GCyzhOBYrxdMm83MEPr9JQ%3Djok3evuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/df8061ee9ae94e00a975556f73444a6f%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

wezell1
So, the current limitation on forwarding via tuckey will only apply if you are forwarding to a dotCMS page - not an external path or a struts/spring/servlet path.  If you are forwarding to page in dotCMS via tuckey, you will need to set the  CMS_FILTER_URLMAP_OVERRIDE value as Chris is doing.

On Mon, Aug 21, 2017 at 1:37 PM, Nathan Keiter <[hidden email]> wrote:

All of ours are type “forward” and they all work in the versions listed. (We have nearly 2 dozen.)

 

We’ve never had any environments on 3.6 however, but I can confirm it works in 4.0.1.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: <a href="tel:(717)%20337-6993" value="+17173376993" target="_blank">717.337.6993

https://www.gettysburg.edu

 

From: 'Chris Falzone' via dotCMS User Group [mailto:[hidden email]]
Sent: Monday, August 21, 2017 9:54 AM
To: [hidden email]
Subject: Re: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

 

This has been an issue since about version 3.6, any rule with the to type of "forward" does not work.

 

 

For example one of our rules for our blog was:

 

        addRewriteRule("^/blog/([A-Za-z0-9\\-]+)/?$", "/blog/post.htm?urlTitle=$1", "forward", "ContentStreamURLMap");

 

This is the workaround we were given:

 

        NormalRule rule = new NormalRule();

        rule.setName("ContentStreamURLMap");

        rule.setFrom("^/blog/([A-Za-z0-9\\-]+)/?$");

        SetAttribute cmsFilterUrlMapOverrideAttribute = new SetAttribute();

        cmsFilterUrlMapOverrideAttribute.setName("CMS_FILTER_URLMAP_OVERRIDE");

        cmsFilterUrlMapOverrideAttribute.setValue("/blog/post.htm?urlTitle=$1");

        rule.addSetAttribute(cmsFilterUrlMapOverrideAttribute);

        addRewriteRule(rule);

 

Which does the trick, but obviously, would like forwards to work properly instead of having to pass them through the CMS filter like this.

 

On Mon, Aug 21, 2017 at 8:50 AM Nathan Keiter <[hidden email]> wrote:

We have been able to use Tuckey rewrite rules to override servlets in the /app/ folder in all latest versions. 2.5.4, 3.5.1, 4.0.1.

 

There is likely something wrong with your plugin.

 

Keep in mind after the rewrite, the original URL won’t work anymore.

 

So if your servlet is registered at “/app/funstuff”, “/app/funstuff” won’t work after mapping it to “/funstuff”.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: <a href="tel:(717)%20337-6993" target="_blank"> 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Monday, August 21, 2017 3:44 AM
To: dotCMS User Group
Subject: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

 

Hi,

 

Is there any update on this?

 

Thank you.

Op vrijdag 23 juni 2017 17:40:10 UTC+2 schreef [hidden email]:

Hi,

 

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

 

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

 

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

 

I've created an example plugin which demonstrates this weird behavior.

 

 

Steps to reproduce:

1. Clone repo

2. Build the plugin with gradlew.jar bat (windows)

3. Upload to your dotCMS instance

 

Visit the page to check if the Hello World Servlet is registered - should be ok

 

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!

Rule created with addRewriteRule() method

 

Rule created with NormalRule class, won't work either

 

Now use Tuckey rewrite rule to forward to a file (image), this works...

 

Can someone please check why this is happenings?


Thanks.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b86190bc-31d5-4a26-84f0-d7e8d822669e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/c98980c1c68a4f84a55a2c7821730598%40exch13b.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAMAbHgXaszYstE6oEf7GCyzhOBYrxdMm83MEPr9JQ%3Djok3evuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/df8061ee9ae94e00a975556f73444a6f%40exch13c.ms.gettysburg.edu.

For more options, visit https://groups.google.com/d/optout.



--






3059 Grand Avenue
Suite 410-B
Miami FL 33133
Main: 
305-900-2001 | Direct: 978.294.9429

   

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAPL0VyEZbKfYkVwNGCecSfRTYrs0i14RBN%3Dxd_RmzPrSw6cOsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

Nathan Keiter
In reply to this post by Nathan Keiter
For example, this Tuckey rule forwards "/createAlumnusAccount​" to "/app/createAlumnusAccount​".


[cid:28b82507-20cc-4a1f-bc59-ecdf9fc1c09b]


[cid:16af961c-e7e4-47c2-a2ea-245bcdbd6d46]


[cid:b1a5e7ef-5bbb-4406-832d-b9b4b9d83d8a]


dotCMS 4.0.1 (DEV)

[cid:2915cb06-4ee0-46a7-ab45-d8d35d330eb4]


dotCMS 3.5.1 (PROD)

[cid:9b6df33d-5f42-4094-be78-8ad3942de8fd]


Nathan I. Keiter | Lead Network Applications Programmer | Administrative Advisory Council Member | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu
________________________________
From: [hidden email] <[hidden email]> on behalf of Nathan Keiter <[hidden email]>
Sent: Monday, August 21, 2017 1:37 PM
To: [hidden email]
Subject: RE: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

All of ours are type “forward” and they all work in the versions listed. (We have nearly 2 dozen.)

We’ve never had any environments on 3.6 however, but I can confirm it works in 4.0.1.

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu<https://www.gettysburg.edu/>

From: 'Chris Falzone' via dotCMS User Group [mailto:[hidden email]]
Sent: Monday, August 21, 2017 9:54 AM
To: [hidden email]
Subject: Re: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

This has been an issue since about version 3.6, any rule with the to type of "forward" does not work.

github issue:  https://github.com/dotCMS/core/issues/9665

For example one of our rules for our blog was:

        addRewriteRule("^/blog/([A-Za-z0-9\\-]+)/?$", "/blog/post.htm?urlTitle=$1", "forward", "ContentStreamURLMap");

This is the workaround we were given:

        NormalRule rule = new NormalRule();
        rule.setName("ContentStreamURLMap");
        rule.setFrom("^/blog/([A-Za-z0-9\\-]+)/?$");
        SetAttribute cmsFilterUrlMapOverrideAttribute = new SetAttribute();
        cmsFilterUrlMapOverrideAttribute.setName("CMS_FILTER_URLMAP_OVERRIDE");
        cmsFilterUrlMapOverrideAttribute.setValue("/blog/post.htm?urlTitle=$1");
        rule.addSetAttribute(cmsFilterUrlMapOverrideAttribute);
        addRewriteRule(rule);

Which does the trick, but obviously, would like forwards to work properly instead of having to pass them through the CMS filter like this.

On Mon, Aug 21, 2017 at 8:50 AM Nathan Keiter <[hidden email]<mailto:[hidden email]>> wrote:
We have been able to use Tuckey rewrite rules to override servlets in the /app/ folder in all latest versions. 2.5.4, 3.5.1, 4.0.1.

There is likely something wrong with your plugin.

Keep in mind after the rewrite, the original URL won’t work anymore.

So if your servlet is registered at “/app/funstuff”, “/app/funstuff” won’t work after mapping it to “/funstuff”.

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993<tel:(717)%20337-6993>
https://www.gettysburg.edu<https://www.gettysburg.edu/>

From: [hidden email]<mailto:[hidden email]> [mailto:[hidden email]<mailto:[hidden email]>] On Behalf Of [hidden email]<mailto:[hidden email]>
Sent: Monday, August 21, 2017 3:44 AM
To: dotCMS User Group
Subject: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

Hi,

Is there any update on this?

Thank you.

Op vrijdag 23 juni 2017 17:40:10 UTC+2 schreef [hidden email]<mailto:[hidden email]>:
Hi,

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

I've created an example plugin which demonstrates this weird behavior.

You can find this plugin here: https://github.com/yasindilekci/com.dotcms.tuckey-servlet

Steps to reproduce:
1. Clone repo
2. Build the plugin with gradlew.jar bat (windows)
3. Upload to your dotCMS instance

Visit the page to check if the Hello World Servlet is registered - should be ok
http://demo.dotcms.com/app/helloworld

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!
Rule created with addRewriteRule() method
http://demo.dotcms.com/foo/bar/servlet-test

Rule created with NormalRule class, won't work either
http://demo.dotcms.com/foo/bar/2servlet-test

Now use Tuckey rewrite rule to forward to a file (image), this works...
http://demo.dotcms.com/foo/bar/image-forward

Can someone please check why this is happenings?

Thanks.
--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]<mailto:[hidden email]>.
To post to this group, send email to [hidden email]<mailto:[hidden email]>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b86190bc-31d5-4a26-84f0-d7e8d822669e%40googlegroups.com<https://groups.google.com/d/msgid/dotcms/b86190bc-31d5-4a26-84f0-d7e8d822669e%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]<mailto:[hidden email]>.
To post to this group, send email to [hidden email]<mailto:[hidden email]>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/c98980c1c68a4f84a55a2c7821730598%40exch13b.ms.gettysburg.edu<https://groups.google.com/d/msgid/dotcms/c98980c1c68a4f84a55a2c7821730598%40exch13b.ms.gettysburg.edu?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]<mailto:[hidden email]>.
To post to this group, send email to [hidden email]<mailto:[hidden email]>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAMAbHgXaszYstE6oEf7GCyzhOBYrxdMm83MEPr9JQ%3Djok3evuw%40mail.gmail.com<https://groups.google.com/d/msgid/dotcms/CAMAbHgXaszYstE6oEf7GCyzhOBYrxdMm83MEPr9JQ%3Djok3evuw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]<mailto:[hidden email]>.
To post to this group, send email to [hidden email]<mailto:[hidden email]>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/df8061ee9ae94e00a975556f73444a6f%40exch13c.ms.gettysburg.edu<https://groups.google.com/d/msgid/dotcms/df8061ee9ae94e00a975556f73444a6f%40exch13c.ms.gettysburg.edu?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1503337672729.95930%40gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

Screen Shot 2017-08-21 at 1.40.16 PM.png (72K) Download Attachment
Screen Shot 2017-08-21 at 1.40.32 PM.png (17K) Download Attachment
Screen Shot 2017-08-21 at 1.40.42 PM.png (28K) Download Attachment
Screen Shot 2017-08-21 at 1.44.04 PM.png (331K) Download Attachment
Screen Shot 2017-08-21 at 1.44.47 PM.png (250K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

Nathan Keiter
In reply to this post by wezell1

Oh, ok.  I don’t think we have any “page” forwards.  Mostly servlets.

 

Thanks for the clarification Will.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Will Ezell
Sent: Monday, August 21, 2017 1:43 PM
To: [hidden email]
Subject: Re: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

 

So, the current limitation on forwarding via tuckey will only apply if you are forwarding to a dotCMS page - not an external path or a struts/spring/servlet path.  If you are forwarding to page in dotCMS via tuckey, you will need to set the  CMS_FILTER_URLMAP_OVERRIDE value as Chris is doing.

 

On Mon, Aug 21, 2017 at 1:37 PM, Nathan Keiter <[hidden email]> wrote:

All of ours are type “forward” and they all work in the versions listed. (We have nearly 2 dozen.)

 

We’ve never had any environments on 3.6 however, but I can confirm it works in 4.0.1.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: <a href="tel:(717)%20337-6993" target="_blank"> 717.337.6993

https://www.gettysburg.edu

 

From: 'Chris Falzone' via dotCMS User Group [mailto:[hidden email]]
Sent: Monday, August 21, 2017 9:54 AM
To: [hidden email]
Subject: Re: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

 

This has been an issue since about version 3.6, any rule with the to type of "forward" does not work.

 

 

For example one of our rules for our blog was:

 

        addRewriteRule("^/blog/([A-Za-z0-9\\-]+)/?$", "/blog/post.htm?urlTitle=$1", "forward", "ContentStreamURLMap");

 

This is the workaround we were given:

 

        NormalRule rule = new NormalRule();

        rule.setName("ContentStreamURLMap");

        rule.setFrom("^/blog/([A-Za-z0-9\\-]+)/?$");

        SetAttribute cmsFilterUrlMapOverrideAttribute = new SetAttribute();

        cmsFilterUrlMapOverrideAttribute.setName("CMS_FILTER_URLMAP_OVERRIDE");

        cmsFilterUrlMapOverrideAttribute.setValue("/blog/post.htm?urlTitle=$1");

        rule.addSetAttribute(cmsFilterUrlMapOverrideAttribute);

        addRewriteRule(rule);

 

Which does the trick, but obviously, would like forwards to work properly instead of having to pass them through the CMS filter like this.

 

On Mon, Aug 21, 2017 at 8:50 AM Nathan Keiter <[hidden email]> wrote:

We have been able to use Tuckey rewrite rules to override servlets in the /app/ folder in all latest versions. 2.5.4, 3.5.1, 4.0.1.

 

There is likely something wrong with your plugin.

 

Keep in mind after the rewrite, the original URL won’t work anymore.

 

So if your servlet is registered at “/app/funstuff”, “/app/funstuff” won’t work after mapping it to “/funstuff”.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: <a href="tel:(717)%20337-6993" target="_blank"> 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Monday, August 21, 2017 3:44 AM
To: dotCMS User Group
Subject: [dotcms] Re: Tuckey rewrite rule to servlet in /app doens't work , bug?

 

Hi,

 

Is there any update on this?

 

Thank you.

Op vrijdag 23 juni 2017 17:40:10 UTC+2 schreef [hidden email]:

Hi,

 

When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.

 

But when I create another Tuckey rewrite rule for something outside /app, for example a file/image, the rewrite rule works.

 

I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.

 

I've created an example plugin which demonstrates this weird behavior.

 

 

Steps to reproduce:

1. Clone repo

2. Build the plugin with gradlew.jar bat (windows)

3. Upload to your dotCMS instance

 

Visit the page to check if the Hello World Servlet is registered - should be ok

 

Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!

Rule created with addRewriteRule() method

 

Rule created with NormalRule class, won't work either

 

Now use Tuckey rewrite rule to forward to a file (image), this works...

 

Can someone please check why this is happenings?


Thanks.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b86190bc-31d5-4a26-84f0-d7e8d822669e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/c98980c1c68a4f84a55a2c7821730598%40exch13b.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAMAbHgXaszYstE6oEf7GCyzhOBYrxdMm83MEPr9JQ%3Djok3evuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/df8061ee9ae94e00a975556f73444a6f%40exch13c.ms.gettysburg.edu.


For more options, visit https://groups.google.com/d/optout.



 

--

 

 

 

 

 

 

3059 Grand Avenue

Suite 410-B

Miami FL 33133

Main: 305-900-2001 | Direct: 978.294.9429

 

   

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAPL0VyEZbKfYkVwNGCecSfRTYrs0i14RBN%3Dxd_RmzPrSw6cOsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/63f6b21ccef041c0bc919bd7eb1e36b1%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.