Returning 'new Redirect( class )' is hitting Tomcat not Apache

1 view
Skip to first unread message

DavidNia

unread,
Jul 31, 2008, 8:52:16 PM7/31/08
to Induction Framework
I have setup Apache and Tomcat on my machine and installed Induction
on Tomcat.

When I make a request through my browser to Apache (port 80), the
request is forwarded to Tomcat (port 8080).

In one of my Induction controllers, I want to redirect to a different
controller, in this case my controller class I want to redirect to is
called test.web.home.Home. I do this by:

return new Redirect( Home.class )

Unfortunatley, what happens is that in my browser URL bar I see,
http://localhost:8080/test/web/home/Home/.

I guess I was expecting the redirect to go to Apache. Am I missing
something...cause this is what I am thinking.

1) I am returning new Redirect( Home.class ) in my controller to
Induction
2) Induction is trying to send a command to the browser to redirect to
some URL
3) Induction has to calculate this URL from the Home.class I gave
it...
4) How is induction supposed to know what URL to send to the browser?

Thanks

Adinath Raveendra-Raj

unread,
Jul 31, 2008, 9:12:03 PM7/31/08
to induction...@googlegroups.com
Hi David,

The short answer to your question is that you need to
write a redirect resolver (a class that implements
RedirectResolver interface) before the you can use the
return ( new Redirect( ... ) ) class.

A redirect resolver is similar to a controller
resolver but it works in reverse.

The reason you are are seeing your redirect go to
Tomcat is because there is a stub implementation of
the RedirectResolver interface that assumes
localhost:8080 is your host, this stub is only meant
as an example and is not useful for your application
as provided.

Let me know if this does not answer your question.

Best,
Adinath

Acciente LLC
Systems Architecture and Software Design
www.acciente.com

DavidNia

unread,
Jul 31, 2008, 9:37:36 PM7/31/08
to Induction Framework
Thanks, it worked !

On Jul 31, 6:12 pm, Adinath Raveendra-Raj <adin...@acciente.com>
wrote:
Reply all
Reply to author
Forward
0 new messages