I guess that it depends on how your servlets are mapping right now. A
web.xml for rails looks like:
<web-app>
...
<filter-mapping>
<filter-name>RackFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
...
</web-app>
so i guess if you put your servlet declaration before the RackFilter
one, everything should work fine. But if the servlets you are using
need to use that pattern, /*, none of the request will reach the rails
application.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
I wonder if it would be worth expanding Warbler to work better with
existing Java servlets/applications, and maybe even make Warbler work
as a general-purpose packager?
I have to admit, I've never really wrapped my head around exactly how
JRuby, Rack, RackFilter, Warbler, and Rails fit together. I think the
ability to stuff a Rails app into an existing WAR file would be truly
outstanding, and something we should make as easy as possible.
And of course with Rails 3, there's the possibility of plugging normal
Java-land libraries into Rails like Hibernate or JSPs, so we need to
start working to blur the lines.
- Charlie
2009/8/5 Jesús García Sáez <bla...@gmail.com>:
> I guess that it depends on how your servlets are mapping right now. AI wonder if it would be worth expanding Warbler to work better with
> web.xml for rails looks like:
>
> <web-app>
> ...
> <filter-mapping>
> <filter-name>RackFilter</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> ...
> </web-app>
existing Java servlets/applications, and maybe even make Warbler work
as a general-purpose packager?
I have to admit, I've never really wrapped my head around exactly how
JRuby, Rack, RackFilter, Warbler, and Rails fit together. I think the
ability to stuff a Rails app into an existing WAR file would be truly
outstanding, and something we should make as easy as possible.
And of course with Rails 3, there's the possibility of plugging normal
Java-land libraries into Rails like Hibernate or JSPs, so we need to
start working to blur the lines.
- Charlie
<!--RAILS CONFIG-->
<filter>
<filter-name>RackFilter</filter-name>
<filter-class>org.jruby.rack.RackFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>RackFilter</filter-name>
<url-pattern>/r/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class>
</listener>
<!--STRUTS CONFIG-->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
...
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/m/*.do</url-pattern>
</servlet-mapping>
> I had a brief stab a while ago at getting RackFilter working on /r/* and
> having another servlet processing /m/*.
Since Filters are evaluated in web.xml-defined-order, couldn't you
have an initial control Filter (both Filters mapped to /*) where the first
forwards to your other servlet(s) based on whatever desired mapping
(breaking the Filter chain) and everything else defaults to Rails?
Untested, but similar to what I've done in other Java apps.
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan