Resin greeter file won't load servlet!

Is it possible for Resin (3.0.27) to map a welcome file to a servlet?

I can't find anything in the Caucho documentation that says this is not supported. Your help would be greatly appreciated.

<servlet-mapping>
    <servlet-name>td</servlet-name>
    <url-pattern>*.htm</url-pattern>
</servlet-mapping>

<welcome-file-list>
    <welcome-file>index.htm</welcome-file>
</welcome-file-list>

      

Edit: If it's not obvious from my post, it doesn't work. :)

Edit: If I put index.htm on the filesystem the servlet mapping works. It's like Resin completes the request if it can't find the physical file.

0


a source to share


1 answer


Due to the fact that caucho_module is loading its config, it can very well ignore the greeter files. The rendering of the welcome file is done by the servlet container (eg "Resin" in your case). But caucho_module seems to be looking for an explicit mapping to help it decide what is going on and what is not going into Resin, versus what Apache will try to serve itself.

Perhaps it is a bug in caucho_module that does not account for the handling of welcome files?

If so, then one way you could get around this would be to use Apache mod_rewrite for the URLs you want to map to a "welcome file". Indeed, an attempt at this may well prove it. For example, something like:



RewriteEngine on
RewriteRule ^/your/url/$  /your/url/index.htm [R=permanent,L]

      

You might want to try versions of the URL that don't execute and don't end with a final slash ... I'm not familiar enough with mod_rewrite to see if this changes. Either way, this will tell Apache to tell the client to redirect (reload the page) the URL that ends in your welcome page. If this fixes the problem then IMO it is a bug in cacho_module.

Another thing to try as a test is going directly to Resin - often on port 8888 - bypassing Apache HTTP to see if it navigates to the welcome page correctly.

+1


a source







All Articles