dev@glassfish.java.net

Re: Rails app is redirected to index.html

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Tue, 15 Jul 2008 13:03:10 -0400

Salut,

Arun Gupta wrote:
> Using the latest v3 Hudson build, I created & deployed a Rails app as
> described at:
>
> http://wiki.glassfish.java.net/Wiki.jsp?page=SimpleRailsApp
>
> The default page at http://localhost:8080/<RAILS_APP> should show the
> Rails page but instead is redirected to localhost:8080/index.html. If I
> create controller/views in the Rails app then they seem to work/show up
> fine.
>
> This used to work fine before the mega changes few days ago. Any idea ?

Yes this is the latest grizzly integration (1.8.2) that produced that
change of behavior:

https://grizzly.dev.java.net/issues/show_bug.cgi?id=168

If you want to change the behavior (because it was a bug before), you
need to add the following inside your JRubyAdapter.service(String,Req,Res):

              if (resource.isDirectory()) {
                 resource = new File(resource, "index.html");
                 cache.put(uri,resource);
              }
              super.service(...);

Follow up the discussion on users|dev_at_grizzly.dev.java.net. I recommend
you subscribe as this was discussed on the dev alias.

A+

-- Jeanfrancois



>
> Thanks,
> -Arun