Using redirect() or setView() but keeping the same URL

264 views
Skip to first unread message

Phil Kemp

unread,
Nov 15, 2013, 10:45:38 AM11/15/13
to framew...@googlegroups.com
Hi,

I would like to know if it is possible to redirect to a different rc.action (that will trigger the appropriate section and subsection controller methods) without changing the URL of the page. I've tried using variables.fw.setView() and variables.fw.redirect() methods, but they both end up redirecting me to the new URL, and I want to have the URL stay as the original one.

Is this possible with FW/1?

Thanks,
Phil

Matt Quackenbush

unread,
Nov 15, 2013, 11:16:40 AM11/15/13
to framew...@googlegroups.com
redirect() is the same as calling <cflocation>. That is, it will always redirect the request by sending a 302 (by default; you can supply the status code if you want to change it).

fw.setView() **does not** redirect the request. If you are seeing a redirect, then you have something else that's causing the redirect.

HTH



--
--
FW/1 on RIAForge: http://fw1.riaforge.org/
 
FW/1 on github: http://github.com/framework-one/fw1
 
FW/1 on Google Groups: http://groups.google.com/group/framework-one
---
You received this message because you are subscribed to the Google Groups "framework-one" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-on...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Phil Kemp

unread,
Nov 15, 2013, 11:40:31 AM11/15/13
to framew...@googlegroups.com
That helps QuackFuzed, thanks!

One of the other developers on the project had a redirect command in the end action method of the controller I was trying to redirect to and that was what was redirecting. Now I know that the setView() method is the one I want, I just have to work out how I can stop their redirection ;)

Thanks!

Nando Breiter

unread,
Nov 15, 2013, 11:46:57 AM11/15/13
to framew...@googlegroups.com

 Now I know that the setView() method is the one I want, I just have to work out how I can stop their redirection ;)


I often use variables to control redirects ... you might pass one in a url or form and that should work fine. 

Nathan Dintenfass

unread,
Nov 15, 2013, 1:01:47 PM11/15/13
to framew...@googlegroups.com
It's a "sledge hammer" approach to this, but you might look at running
abortController() right after your setView() if you are sure you don't
need anything in the after() to run (a fragile solution, but it would be
effective to solve this particular problem).
> it, send an email to framework-on...@googlegroups.com <javascript:>.
> For more options, visit https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
Reply all
Reply to author
Forward
0 new messages