Can Apache serve jsp without an app server?


#1

Hello all,

I have a legacy web app that I’m replacing in rails. This app is
public, so
I need to over-ride the exising login.jsp that has other external links
and
probably many bookmark entries in customer browsers.

So, what I’d like to do is replace the login.jsp with a login.jsp that
just
has a redirect to my rails login url… is this possible? Also, one of
the
external links passes some params to the jsp as well… can the redirect
also
forward those parameters to my rails login url ?

Thanks for your advice!


#2

You could add a AddHandler in your .htaccess file that tells apache to
render files with a .jsp extension in PHP. That way you could use PHP to
gather the parameters and do the redirect:

Addhandler php-script .php .jsp

peter.fitzgibbons wrote:

Hello all,

I have a legacy web app that I’m replacing in rails. This app is
public, so
I need to over-ride the exising login.jsp that has other external links
and
probably many bookmark entries in customer browsers.

So, what I’d like to do is replace the login.jsp with a login.jsp that
just
has a redirect to my rails login url… is this possible? Also, one of
the
external links passes some params to the jsp as well… can the redirect
also
forward those parameters to my rails login url ?

Thanks for your advice!


#3

Am Dienstag, den 29.11.2005, 15:58 -0600 schrieb Peter F.:

the redirect also forward those parameters to my rails login url ?

Thanks for your advice!

Try something like this in your Rails .htaccess file as the first
rewrite rule (untested):

RewriteRule ^login.jsp(.*)$ /your_login_controller/your_login_action/$1


#4

HI Brad,
Since I have no PHP knowledge, could you provide an example ?

Thanks.

On 11/29/05, Brad D. removed_email_address@domain.invalid wrote:

I have a legacy web app that I’m replacing in rails. This app is
also
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#5

I used a route to solve this :

map.connect ‘UserLogin.jsp’, :controller=>“user”,
:action=>“remote_login”

My intent with this change is simply ot send the request into the rails
app
and perform processing there (this is a login page from a legacy j2ee
app).
So, this route sends the request into my controller just the way I want
it.

Thanks for your advice Brad!

On 11/30/05, Peter F. removed_email_address@domain.invalid wrote:

gather the parameters and do the redirect:

and
forward those parameters to my rails login url ?
removed_email_address@domain.invalid