Title: [465] trunk/rails-integration/plugins/war-snapshot/lib: Allow FileServlet to fall back to RailsServlet
Revision
465
Author
tantalon
Date
2007-04-18 20:15:46 -0400 (Wed, 18 Apr 2007)

Log Message

Allow FileServlet to fall back to RailsServlet

Modified Paths


Diff

Modified: trunk/rails-integration/plugins/war-snapshot/lib/create_war.rb (464 => 465)


--- trunk/rails-integration/plugins/war-snapshot/lib/create_war.rb	2007-04-18 21:28:02 UTC (rev 464)
+++ trunk/rails-integration/plugins/war-snapshot/lib/create_war.rb	2007-04-19 00:15:46 UTC (rev 465)
@@ -102,6 +102,12 @@
   <param-value><%= config.rails_env %></param-value>
 </context-param>
 
+<context-param>
+  <description>The files servlet should forward to the rails servlet if no file could be found</description>
+  <param-name>files.default</param-name>
+  <param-value>rails</param-value>
+</context-param>
+
 <servlet>
   <servlet-name>rails</servlet-name>
   <servlet-class><%= config.servlet %></servlet-class>
@@ -111,17 +117,9 @@
   <servlet-class>org.jruby.webapp.FileServlet</servlet-class>
 </servlet>
 
-<!-- Handle static files with the file servlet -->
-<% for public_file in public_files %>
+<!-- Allow all requests to go to the files servlet first -->
 <servlet-mapping>
   <servlet-name>files</servlet-name>
-  <url-pattern><%= public_file %></url-pattern>
-</servlet-mapping>
-<% end %>
-
-<!-- Allow Rails to handle everything else -->
-<servlet-mapping>
-  <servlet-name>rails</servlet-name>
   <url-pattern>/</url-pattern>
 </servlet-mapping>
 
@@ -136,16 +134,6 @@
 </web-app>
 END_OF_WEB_INF
 
-      public_dir = File.join(config.staging, 'public')
-      public_files = []
-      public_filelist = Rake::FileList.new(File.join(public_dir, '**', '*'))
-      public_filelist.each do |f|
-        unless File.directory?(f)
-          relative = f[public_dir.length..f.length]
-          public_files << relative
-        end
-      end
-
       erb = ERB.new(template)
       erb.result(binding)
     end

Modified: trunk/rails-integration/plugins/war-snapshot/lib/run.rb (464 => 465)


--- trunk/rails-integration/plugins/war-snapshot/lib/run.rb	2007-04-18 21:28:02 UTC (rev 464)
+++ trunk/rails-integration/plugins/war-snapshot/lib/run.rb	2007-04-19 00:15:46 UTC (rev 465)
@@ -18,6 +18,7 @@
       @jetty_port = 8080
       @jetty_tmp = File.join('tmp', 'jetty')
       @jetty_config = File.join(jetty_tmp, 'jetty.xml')
+      @java_opts = ''
     end
     
     def run_standalone
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to