jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-2015

"RAILS_ROOT" cannot be put on a place different from "Context root" in Goldspike.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Wish Wish
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Rails WAR Deployment
  • Labels:
    None
  • Environment:
    Windows XP SP2, JDK 1.6.0_04, Tomcat6.0.14, JRuby 1.1RC1

Description

I wanted to put "RAILS_ROOT" on a place different from "Context root" by using "Goldspike".
However, it cannot have been done.
This patch solves this problem.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    goldspike.patch
    21/Jan/08 11:17 PM
    2 kB
    Osamu Goto

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Nick Sieger added a comment - 22/Jan/08 9:04 AM

Did you try setting a context init parameter rails.root to achieve this?

<context-param>
  <param-name>rails.root</param-name>
  <param-value>/subpath</param-value>
</context-param>
Show
Nick Sieger added a comment - 22/Jan/08 9:04 AM Did you try setting a context init parameter rails.root to achieve this?
<context-param>
  <param-name>rails.root</param-name>
  <param-value>/subpath</param-value>
</context-param>
Hide
Permalink
Robert Egglestone added a comment - 22/Jan/08 2:10 PM

RAILS_ROOT is the location on the file system of the Rails app (relative to the WAR).
Context root is the URL path where the Rails app is to be mounted.

Looking at the patch, I guess you want to be able to:
+ Set the context root to /mywar
+ Mount the Rails app at /mywar/app1
i.e. a context root extension of sorts

Is this correct?

Show
Robert Egglestone added a comment - 22/Jan/08 2:10 PM RAILS_ROOT is the location on the file system of the Rails app (relative to the WAR). Context root is the URL path where the Rails app is to be mounted. Looking at the patch, I guess you want to be able to: + Set the context root to /mywar + Mount the Rails app at /mywar/app1 i.e. a context root extension of sorts Is this correct?
Hide
Permalink
Osamu Goto added a comment - 22/Jan/08 7:55 PM

>Looking at the patch, I guess you want to be able to:
>+ Set the context root to /mywar
>+ Mount the Rails app at /mywar/app1
>i.e. a context root extension of sorts

Yes. It is correct.
ex)
context root to /mywar
RAILS_ROOT=[context root real path]/WEB-INF/rails

--start of web.xml –
<context-param>
<param-name>rails.root</param-name>
<param-value>/WEB-INF/rails</param-value>
</context-param>
<context-param>
<param-name>files.prefix</param-name>
<param-value>/WEB-INF/rails/public</param-value>
</context-param>
~~
<servlet-mapping>
<servlet-name>files</servlet-name>
<url-pattern>/app1/*</url-pattern>
</servlet-mapping>
– end of web.xml –

In this case, when I access to
/mywar/app1
I want rails application to work.

Show
Osamu Goto added a comment - 22/Jan/08 7:55 PM >Looking at the patch, I guess you want to be able to: >+ Set the context root to /mywar >+ Mount the Rails app at /mywar/app1 >i.e. a context root extension of sorts Yes. It is correct. ex) context root to /mywar RAILS_ROOT=[context root real path]/WEB-INF/rails --start of web.xml – <context-param> <param-name>rails.root</param-name> <param-value>/WEB-INF/rails</param-value> </context-param> <context-param> <param-name>files.prefix</param-name> <param-value>/WEB-INF/rails/public</param-value> </context-param> ~~ <servlet-mapping> <servlet-name>files</servlet-name> <url-pattern>/app1/*</url-pattern> </servlet-mapping> – end of web.xml – In this case, when I access to /mywar/app1 I want rails application to work.
Hide
Permalink
Robert Egglestone added a comment - 17/Feb/08 3:29 PM

What's the redirect for?

I don't know how getServletPath differs between application servers, so this will need to be tested on multiple servers to ensure we don't regress. At a minimum we'd need to test it on Jetty, Tomcat, WebLogic and Glassfish. I don't have time to do that testing now, however if anyone can confirm it works, I'll apply the patch. Otherwise I'll look towards getting the testing done when I can.

Show
Robert Egglestone added a comment - 17/Feb/08 3:29 PM What's the redirect for? I don't know how getServletPath differs between application servers, so this will need to be tested on multiple servers to ensure we don't regress. At a minimum we'd need to test it on Jetty, Tomcat, WebLogic and Glassfish. I don't have time to do that testing now, however if anyone can confirm it works, I'll apply the patch. Otherwise I'll look towards getting the testing done when I can.
Hide
Permalink
Osamu Goto added a comment - 17/Feb/08 8:38 PM

The redirected reason is that a wrong result case.

If the end of request path is not "/"
and relative path is included in HTML,
the result is different from expected.

For example, if
<a href="rails/info/properties"/>
included in index.html.

When the request is
http://localhost/app1/
, the result is
http://localhost/app1/rails/info/properties
.

However,
When the request is
http://localhost/app1
, the result is
http://localhost/rails/info/properties
.

Show
Osamu Goto added a comment - 17/Feb/08 8:38 PM The redirected reason is that a wrong result case. If the end of request path is not "/" and relative path is included in HTML, the result is different from expected. For example, if <a href="rails/info/properties"/> included in index.html. When the request is http://localhost/app1/ , the result is http://localhost/app1/rails/info/properties . However, When the request is http://localhost/app1 , the result is http://localhost/rails/info/properties .
Hide
Permalink
Charles Oliver Nutter added a comment - 04/Feb/09 12:08 AM

GoldSpike has long been deprecated in favor of Warbler, so I'm marking this as "won't fix". There are no GoldSpike maintainers left. If you'd like to take it over yourself and apply this patch, feel free to let us know and reopen the bug.

Show
Charles Oliver Nutter added a comment - 04/Feb/09 12:08 AM GoldSpike has long been deprecated in favor of Warbler, so I'm marking this as "won't fix". There are no GoldSpike maintainers left. If you'd like to take it over yourself and apply this patch, feel free to let us know and reopen the bug.

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Osamu Goto
Vote (0)
Watch (2)

Dates

  • Created:
    21/Jan/08 11:17 PM
    Updated:
    27/Oct/09 1:48 PM
    Resolved:
    04/Feb/09 12:08 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.