The resource serving servlet is FileServlet.
In web.xml, the default servlet is RailsServlet, so every file or
directory under public needs a mapping explicitly specified pointing it
to FileServlet.
Unfortunately, it looks like the process used by the plugin to generate
this list is breaking under JRuby. I suspect this is related to
canonicalization of the file paths, which happens in JRuby but not in Ruby.
Cheers,
Robert
Craig McClanahan wrote:
On 4/16/07, Charles Oliver Nutter <[EMAIL PROTECTED]> wrote:
Charles Oliver Nutter wrote:
Charles Oliver Nutter wrote:
I'm seeing some rather unusual servlet URIs set up in web.xml, and
GlassFish isn't liking them one bit. they look corrupted as well...
Fixing them with /tmp/war/* and /tmp/war/public/* seems to fix the
problem. Perhaps this is a lingering bug in the new String implementation?
These fixes didn't appear to allow content under public/ to be served,
so stylesheets and javascripts fail to come through. So there's
something not quite right here. How can I get static content URLs to map
correctly to the files under public? Mapping URLs with /tmp/anything
seems completely wrong...
You're running into some differing assumptions between Java webapps
and Rails webapps.
For Java webapps:
* The "document root" of a particular application is considered
to be the top level directory of the WAR.
* The application server imposes the notion of a "context path"
immediately after the hostname, such that multiple web
applications can be run on one server.
* Generally, a context-local path that starts with a "/" is interpreted
relative to the document root of the app that is selected by
matching the context path. This is the case, for example,
when interpreting servlet mappings.
* Putting this all together, assume you have an application
at context path "/myapp", and you are processing URL
"http://myhost/myapp/foo/bar.html". This will get resolved
to resource "/foo/bar.html" in this application, which could
(for example) be mapped to a servlet with "/foo/*" or "*.html".
For Rails webapps:
* The "document root" of a particular application is considered
to be the "public" directory of the application directory tree.
(We probably want to figure out how to make this mapping
transparently for the "Rails app in a WAR" deployment scenario).
* [Rails newbie alert] AFAICT, there is no real notion of "context
path" ... although your webserver will typically be configured
with proxy settings or whatever to accomplish the same sort of purpose.
The simplest next step might be a resource-serving servlet that
behaves the way that the default resource-serving servlet does in a
Java webapp, but starts at the "public" directory instead. Every
appserver and servlet container has such a thing; unfortunately they
are not standardized so we either need to make our own (and include it
in the WAR), or create server-specific configurations for each
deployment scenario.
I believe the first solution is the most appropriate one. And, once I
actually finish my late JavaOne slides :-) I can volunteer to take a
crack at providing one.
Craig
And good news...I have Mephisto deploying and apparently working on
GlassFish. Neato!
Main page looking ok, managed to get admin page coming up with
stylesheet and javascript, but upon logging in I get a nifty failure
(potentially a GlassFish or Tomcat/Catalina issue). Anyone seen this?
[#|2007-04-16T18:23:45.202-0500|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=17;_ThreadName=h
ttpSSLWorkerThread-8080-0;_RequestID=30dd7374-77bf-489c-960a-a670a805979d;|StandardWrapperValve[rails]:
PWC1406: Servlet
.service() for servlet rails threw exception
java.lang.ThreadDeath
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1342)
at java.security.Provider$Service.getImplClass(Provider.java:1218)
at java.security.Provider$Service.newInstance(Provider.java:1176)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:220)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:190)
at java.security.Security.getImpl(Security.java:662)
at java.security.MessageDigest.getInstance(MessageDigest.java:185)
at org.jruby.RubyDigest$Base.s_hexdigest(RubyDigest.java:148)
at sun.reflect.GeneratedMethodAccessor1094.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:589)
at
org.jruby.runtime.callback.ReflectionCallback.execute(ReflectionCallback.java:158)
- 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
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel