Here the complete debug log.
====== BOOT STRAP ====================
[1390] mapping.DefaultUrlMappingsHolder Reverse mapping:
[DefaultUrlMappingsHolder.UrlMappingKey@1087359 controller = [null],
action = [null], params = set[[empty]]] ->
org.codehaus.groovy.grails.web.mapping.ResponseCodeUrlMapping@1ccf342
[1390] mapping.DefaultUrlMappingsHolder Reverse mapping:
[DefaultUrlMappingsHolder.UrlMappingKey@7691c0 controller = [null],
action = [null], params = set['controller']] -> /(*)/(*)?/(*)?
[1390] mapping.DefaultUrlMappingsHolder Reverse mapping:
[DefaultUrlMappingsHolder.UrlMappingKey@5b02a6 controller = [null],
action = [null], params = set['action', 'controller']] -> /(*)/(*)?/
(*)?
[1392] mapping.DefaultUrlMappingsHolder Reverse mapping:
[DefaultUrlMappingsHolder.UrlMappingKey@10aefdb controller = [null],
action = [null], params = set['id', 'action', 'controller']] -> /(*)/
(*)?/(*)?
[2855] mapping.DefaultUrlMappingsHolder Reverse mapping:
[DefaultUrlMappingsHolder.UrlMappingKey@154145 controller = [null],
action = [null], params = set[[empty]]] ->
org.codehaus.groovy.grails.web.mapping.ResponseCodeUrlMapping@17035c6
[2855] mapping.DefaultUrlMappingsHolder Reverse mapping:
[DefaultUrlMappingsHolder.UrlMappingKey@1da997a controller = [null],
action = [null], params = set['controller']] -> /(*)/(*)?/(*)?
[2855] mapping.DefaultUrlMappingsHolder Reverse mapping:
[DefaultUrlMappingsHolder.UrlMappingKey@921a90 controller = [null],
action = [null], params = set['action', 'controller']] -> /(*)/(*)?/
(*)?
[2856] mapping.DefaultUrlMappingsHolder Reverse mapping:
[DefaultUrlMappingsHolder.UrlMappingKey@de648 controller = [null],
action = [null], params = set['id', 'action', 'controller']] -> /(*)/
(*)?/(*)?
2008-07-16 17:00:18.624:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.utils.Log DEBUG: logLevel set to
DEBUG
2008-07-16 17:00:18.624:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: confPath set
to /WEB-INF/urlrewrite.xml
2008-07-16 17:00:18.638:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.Conf DEBUG: XML builder factory is:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
2008-07-16 17:00:18.641:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.Conf DEBUG: XML Parser:
org.apache.xerces.jaxp.DocumentBuilderImpl
2008-07-16 17:00:18.641:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.Conf DEBUG: about to parse conf
2008-07-16 17:00:18.642:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.ConfHandler DEBUG: Resolving to DTD /
org/tuckey/web/filters/urlrewrite/dtds/urlrewrite3.1.dtd
2008-07-16 17:00:18.658:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.Conf DEBUG: now initialising conf
2008-07-16 17:00:18.664:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: loaded rule Rule 0 (/
mytest, /products/index 1)
2008-07-16 17:00:18.664:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.NormalRule DEBUG: loaded rule Rule 0
(/mytest, /products/index 1)
2008-07-16 17:00:18.664:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: inited with
1 rules
2008-07-16 17:00:18.664:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: conf is ok
2008-07-16 17:00:18.666:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf
ok)
2008-07-16 17:00:18.735:/webapp:INFO: Initializing Spring
FrameworkServlet 'grails'
2008-07-16 17:00:18.904::INFO: Started
SelectChann...@0.0.0.0:8080
Server running. Browse to
http://localhost:8080/webapp
=========== Direct Grails URL request (/webapp/products/index)
=====================
2008-07-16 17:00:31.578:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG:
looking for hostname match on current server name localhost
2008-07-16 17:00:31.580:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for
status path on /webapp/products/index
2008-07-16 17:00:31.580:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing
request for /webapp/products/index
2008-07-16 17:00:31.580:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: context removed
from url
2008-07-16 17:00:31.584:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called
with /products/index
[16217] mapping.DefaultUrlMappingsHolder Attempting to match URI [/
products/index] with pattern [500]
[16218] mapping.DefaultUrlMappingsHolder Attempting to match URI [/
products/index] with pattern [/(*)/(*)?/(*)?]
[16237] mapping.DefaultUrlMappingsHolder Matched URI [/products/index]
with pattern [/(*)/(*)?/(*)?], adding to posibilities
=========== Rewritten URL request (/webapp/mytest) ==================
2008-07-16 17:00:41.417:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG:
looking for hostname match on current server name localhost
2008-07-16 17:00:41.417:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for
status path on /webapp/mytest
2008-07-16 17:00:41.417:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing
request for /webapp/mytest
2008-07-16 17:00:41.417:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: context removed
from url
2008-07-16 17:00:41.418:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called
with /mytest
2008-07-16 17:00:41.418:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from"
2008-07-16 17:00:41.422:/webapp:INFO:
org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs to
be forwarded to /products/index
As you can see, a direct Grails URL request works as expected:
Urlrewrite will filter it first and won't find a rule for it, and then
Grails urlmapping will find a rule and shows the page.
In the second request -the rewritten URL request- Urlrewrite will find
a rule and forwards it to /webapp/products/index, BUT Grails
urlmapping doesn't seem to be called now???
And a 404 page will show: "NOT_FOUND RequestURI=/webapp/products/
index".
Any ideas why Grails urlmapping doesn't work when an URL is forwarded
by Urlrewrite? Grails should be unaware of any action performed by
Urlrewrite, right?