core icon indicating copy to clipboard operation
core copied to clipboard

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

Open yasindilekci opened this issue 9 years ago • 1 comments

This issue only occurs in dotCMS 4.0.0 and higher, in dotCMS 3.x.x it works fine.

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 or 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.

Expected Behavior

We should be able to create a Tuckey rewrite rule for a servlet that is located under /app.

Current Behavior

The rewrite rule created for a servlet located under /app doesn't forward to the servlet that is located under /app.

Possible Solution

It's working in dotCMS 3, but not in dotCMS 4.

Known Workarounds

None.

Steps to Reproduce (for bugs)

  1. Clone the example plugin that I've created
  2. Build the plugin with gradlew.jar bat (windows)
  3. Upload to your dotCMS instance
  4. Visit the page to check if the Hello World Servlet is registered - should be ok

http://demo.dotcms.com/app/helloworld

  1. Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!
  • Rule created with addRewriteRule() method, doesn't work 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

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

http://demo.dotcms.com/foo/bar/image-forward

Context

We need this forward for our Minifier plugin to prevent extra requests for CSS/JS, you can find this plugin here (different branch for dotCMS 4.x.x)

Your Environment

  • dotCMS version used: 4.1.1
  • Browser Name: Chrome/FireFox/IE (doesn't matter)
  • Operating System: Windows
  • Java version: 1.8.0_131
  • Database: MS SQL Server

yasindilekci avatar Jul 04 '17 08:07 yasindilekci

This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.

stale[bot] avatar Sep 28 '19 13:09 stale[bot]