Hi Sergio,
On Dec 12, 2007 7:49 AM, Sergio Oliveira <sergio.soujava@gmail.com> wrote:
> How do I do a simple forward from a ruby servlet to a rhtml file. Any link
> or tutorial that would explain me how to do that?
If you mean rhtml file will be downloaded from WEBrick::HTTPServer,
that is :MimeTypes problem. I recently found default setting is not good.
Try this version of httpd.rb:
-----------------------------------
require "webrick"
mime = WEBrick::HTTPUtils::DefaultMimeTypes.dup
mime["rhtml"] = "text/html"
httpd = WEBrick::HTTPServer.new(
:DocumentRoot => File::dirname(__FILE__),
:Port => 10080,
:MimeTypes => mime
)
trap(:INT){ httpd.shutdown }
httpd.start
-----------------------------------
with sample.rhtml
-----------------------------------
<title>time</title>
<%= Time.now %>
-----------------------------------
--
Gotoken