It feels like in order to emulate Rails behavior as close as possible we should merge FileServlet and RailsServlet. RailsServlet would initially check if the file is in "public", if it is serve it from there, if it's not serve it from Rails. Because this exactly mirrors how Rails/Apache behaves I think it should take care of most "hacks" out there (including file_column, Mephisto, Typo etc).
Cheers, Jon ---- New from ThoughtWorks: Mingle, an Agile project management application. Mingle. Project Intelligence. Powerfully Simple. More at http://studios.thoughtworks.com On 18/04/2007, at 2:42 PM, Charles Oliver Nutter wrote: > (but not a particularly elegant one). > > So as I mentioned before, Mephisto wants to route most requests for > static content through its theming engine. This means that in general > the simple wildcarding of subdirectories under public doesn't > work...it > causes all requests for static content to get routed to the file > servlet, when there should actually be a fallback on the Rails servlet > if a file isn't found. > > So obviously the correct fix is that the file servlet and the rails > servlet should be on friendly terms, with the file servlet failing > over > to the Rails servlet when a file doesn't exist, and allowing Rails to > handle it. This would be standard Rails behavior, or so it would seem. > > My temporary fix seems to be working "well enough" however, and I am > able to deploy a fully-working Mephisto instance locally. Here's the > change I made in create_war.rb: > > public_dir = File.join(config.staging, 'public') > public_files = [] > public_filelist = Rake::FileList.new(File.join(public_dir, > '**/*')) > public_filelist.each do |f| > relative = f[public_dir.length..f.length] > #relative += File::SEPARATOR + '*' if File.directory?(f) > public_files << relative unless File.directory?(f) > end > > Yup, you're reading that right...instead of adding all files under > public directly and all directories as wildcarded paths, this adds all > files under all directories by name to web.xml. That certainly > clutters > up the descriptor, but it allows only files that actually exist to be > handled by the file servlet. > > The correct solution would be much nicer, of course, so I'll see if I > can't look into that next. But this workaround functions reasonably > well. > > - Charlie > _______________________________________________ > Jruby-extras-devel mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/jruby-extras-devel _______________________________________________ Jruby-extras-devel mailing list [email protected] http://rubyforge.org/mailman/listinfo/jruby-extras-devel
