CFLOCATION
Hi,
I am using cflocation to redirect to a page after doing
process on server side like database updates, some time the page is
redirecting properly and the content of the new page also
displaying, and some times it is redirecting to a new page but the
content is not displaying..if i refresh the browser then content is
display.
Wondering if any one come across this type of situation.
Looking for your suggestions in fixing this issue.
Thanks in advance
-Raaga
Not sure if this is your problem, but CFLOCATION has a
history. For example, CFLOCATION used after a CFCOOKIE call used to
forward without executing the CFCOOKIE. I haven't used CFLOCATION
since then. Instead I use JavaScript to forward since that will not
run until CF is finished executing.
<CF CODE>
<script>
location.href='updated_page.cfm';
</script>
Similar Messages
-
How Do I send variables to new window since cflocation won't work?
I have a form that sends data to itself using <FORM action="#getfilefrompath(cgi.script_name)#" method="post">
It is then either saved or updated, then the flyer_id sent to pdf_view.cfm to view it in a PDF format. I am using cflocation to go to another page with the flyer_id:
<cflocation url="flyer_pdf.cfm?flyer_id=#flyer_id#">
Where the flyer_id is used to query the appropriate info on the pdf_view.cfm. What I really would like to happen is the varable flyer_id to automatically open the pdf_view.cfm page in a new window, after saving/updating the flyer.
How can this be done?Hi rickaclark54,
You can open a new window using javascript.Please take a look at the following example.
Page Name:Openwindow.cfm
<!--- Do what operation you want to perform here --->
<!--- The following code will a new window --->
<cfset flyer_idvar=45>
<script type="text/javascript">
window.open('openwindowcont.cfm?flyer_id=<cfoutput>#flyer_idvar#</cfoutput>','_blank','wi dth=400,height=200')
</script>
Page Name:openWindowcont.cfm
<cfif isDefined("URL.flyer_id")>
<cfoutput>#URL.flyer_id#</cfoutput>
<cfelse>
<cfoutput>in not available!!!!!!!</cfoutput>
</cfif>
by this way you can open a new window and pass data through url.
Thanks
Saurav -
I have a page that redirects the user after they have successfully logged in. Everything was working great on my test server but when I uploaded it to launch the site the redirect after logging in stopped working.
User enters info and hits submit
Code logs in user
Blank page is shown
Refresh that page (without resubmitting form)
User was successfully logged in.
So the page is going to the login script, they are being logged in but the cflocation is not redirecting on my IIS server but it was on Apache. There are no cfflush or cfdump tags found in the entire site.
Any ideas? Thanks!Thanks for the response! I've checked all the rules and files. All is good.
It looks to me that everything is working but the cflocation. If I manually go to the page the cflocation was being redirected to all of the code executed before the cflocation has been executed (logging the user in).
It's just the cflocation not working.
An other thoughts? Thanks again! -
Cflocation dropping characters
Specifically it's dropping the ampersand "&" and all characters after this.
I have a simple search form that sends the search item to an action page where depending on what variables are sent it either processes the form or sends the variable in the url to another page to get processed.
The form sends the variables correctly to the processing page. Using cfdump I see I'm getting the correct search item. Then I use cflocation to send the search item to a different page for processing but at this point on the third page the variable is missing anything behind the ampersand. "A&B" becomes "A"
My processing page looks like this.
<cfif IsDefined("form.how") and #form.how# eq "any">
<cfset theitem = #trim(form.item)#>
<cflocation url="search.cfm?item=#theitem#" addtoken="no">
</cfif>
I receive "A&B" on this processing page but on the search.cfm page when dumping out the url variable I receive "A" and everything beyond and including the & is stripped.
I've tried setting the item variable as a session variable on the processing page but that didn't work either. I've tried using a meta refresh tag but got the same results. I've googled and do not see anything on this.
The "&" sign should be a valid character to search for in the database.
Any suggestions? thanksWell... & has special meaning in a URL, doesn't it? it's the separator between parameter name/value pairs. So if you need it to be in your data (ie: the value of a parameter) you need to encode it so the web server KNOWS it's data and not part of the URL structure.
On CF10 use encodeForUrl():
http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WS932f2e4c7c04df8f-6f7941141353e2963af -7ffc.html
On previous versions use urlEncodedFormat():
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7b df.html
Adam -
We recently upgraded to IE 11 as our browser at work and I noticed today that any document that has a cflocation is having problems. On the first try, the cflocation code is ignore. Subsequent attempts show the browser 'working' but not doing anything.
While I could put our site in the compatibility list, it means that any of all of our users would have to do the same. Is there a workaround?
As an example, this is one page of our site:
Mackenzie Tuttle Receives the Don Davoren Rocky Mountains Regional Scholarship
I have breadcrumbs at the top of the page. If you click on one of the last few (2014, honour-awards, committees) you go to the root of that directory which has an index.cfm that redirects to the appropriate location.
This worked fine in IE 9 and works fine in Chrome and other browsers. It seems to be an IE 11 thing.
SueI opened your link in IE 11 and clicked on (2014, honour-awards, committees). Everything seems to work as expected.
If it fails for you, then could you please let us know how you implement cflocation? What do you then expect to happen? What actually happens? -
Trouble with CFLOCATION and Proxy Servers
Hi,
Trying to troubleshoot an annoying issue and wondering if
anyone has had any experience with this - haven't had much luck
Googling for info. Using up-to-date CF 6.1 and current version of
Apache 2.0. Client is accessing our CF webapps via a clustered
proxy server/firewall archicture. Each time client users HTTP POST
through one of our applications, the page they are redirected to
only displays a small portion of unprocessed raw source page
content, the remaining page content never seems to make it to the
client's browser. The only way they can a valid version of the page
is to refresh the browser. I verified that small portion of raw
source content is returned by the application during these
redirects using an HTTP sniffer, however my office PC still
redirects to the correct page. We are using <CFLOCATION> tags
to move users between pages after submitting.
I suspect this problem has to do with their proxy server(s)
holding HTTP 302 responses to the literal standard, which
(paraphrasing) basically states that while the URI has been moved,
it is up to the client to continue the actual redirect. I believe
HTTP 303 responses would be the "correct" implementation. Having
said that, we've never run into this issue with any other client
users before.
Has anyone ever run into similar issues before? Any help is
greatly appreciated.
Thanks,
DTSReplace
byte[] buf = null;with
byte[] buf = new byte[ 256 ];Other problems may happen if this sample was not tested properly.
The problem is that the DatagramPacket requires you to supply a non-null buffer, as per:
DatagramPacket
public DatagramPacket(byte[] buf, int length)
Constructs a DatagramPacket for receiving packets of length length.
The length argument must be less than or equal to buf.length.
Parameters:
buf - buffer for holding the incoming datagram.
length - the number of bytes to read.
Edited by: baftos on Jul 18, 2008 3:38 PM -
Does cflocation cancel sessions?
In ColdFusion 7 (or above) is this true or not? If it is, I
need to dramatically modify my CMS security structure.
The problem in other words...
If a CMS login routine and subsequent cfif redirects, all
using cflocation plus url variables, is build in a way that some
data is retain in session variables, and IF it is true that
cflocation usage erases session variables, then... I have a problem
Hope you can shet some light on this.
Thanks!
HansDoes cflocation cancel sessions
Yes,
cflocation
can. However, it wont if you set the addToken attribute to Yes. -
Cflocation problem, opening new browser tab
I have a cfform with several submit buttons. The form action is itself and depending on what submit button is pressed a different function from a cfc is invoked and then I'm trying to use cfloaction to launch a new page. When this happens it is opening a new tab in both fire fox and IE instead of opening the new location within the same browser tab. From reading the documentation for cfloaction this should not be happening and I do not want it to launch in a new window. What could be causing this to happen?
Hi John,
I agree with Adam on the <cflocation> tag. I suspect it is a browser setting.
Like in FireFox
Tools/Options/Tabs
[X] Open new windows in a new tab
Like in IE,ver7
Tools/Internet Options/General Tab/Tab Section/Settings button
then bottom section "Open links from other programs in"
[X] A new tab in the current window
Try unchecking these boxes and then try your process again. Not
saying this will correct your issue, but does seem like a browser
issue to me as well and not <cflocation>
Leonard -
Heads-up: bug introduced into CFABORT & CFLOCATION in CF9
G'day
This is just a heads-up about a not-insignificant bug Ben Nadel has spotted with CFABORT (and the same thing applies to CFLOCATION) in CF9.
The blog entry is here:
http://www.bennadel.com/blog/2221-CFAbort-And-OnRequestEnd-Behavior-In-ColdFusion-8-And-Co ldFusion-9.htm
The short version is that prior to CF9, CFABORT meant "abort processing". In CF9, it now only kinda aborts processing, as whilst it halts "mainline" code from running, it still executes onRequestEnd().
It seems that this change came about from a "bug" raised with Adobe here:
http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=80798
This is not a bug (Mark's raised it as a bug, not an enhancement request), as it's been the way CFABORT had always previously worked. I can see an argument as to how Mark's suggestion could be handy, but monkeying with CFABORT's default behaviour was not the solution here.
We've just upgraded our CF servers to CF9, and now we need to recode certain parts of our app to work around this. So we're not overly happy about this.
I've raised a bug report suggesting this change is backed out and delivered as a hotfix:
http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=86960
If it's the sort of thing that would affect you - or if you're just as annoyed as I am about Adobe changing the default behaviour of its really really fundamental tags for no good (/well-thought-out ~) reason, then pls vote for it.
Cheers.
AdamThat is indeed ridiculous, I've added my vote.
-
Application.cfm /cflocation and redirection of changed link
I have a link on my site http://www.mysite.com/ssl/oldpage.cfm that I have renamed to http://www.mysite.com/ssl/newpage.cfm.
Many of my users have the old page bookmarked etc..................
Is there a way to put code in the application.cfm that says if user trys to go to old page automatically redirect them to the new page?Not in the application CFC.
But there is a great place to put code like that in most web server configurations.
If not that, then the next level would be defining the "missing template handler" in the ColdFusion administrator.
Finally, if you can't do either or those, keep the old file, but replace all of it's code with a <cfheader...> redirect (or a <cflocation...> permanent redirect if you are on a new version of ColdFusion.
But, really, this is a web server level task and that is the best place to put this if you have contorl of yours. -
"cflocation" Page Referer is gone
I am trying to redirect users based on a value of a session
variable when the page is refreshed.
This is working very well, but when the user clicks the back
button, they loose the referring page where they started.
glare.cfm is the main page, when this page is refreshed and
the user is redirected to another page through the
<cflocation> tag, the referring page "glare.cfm" disappears.
When user clicks the back button, I need to redirect back to
the glare.cfm.also if your using cookies to keep the pages in order...keep
in mind...cflocation and cfcookies dont mix very well.. -
CF9, CFLocation, URL Problem
Hey all,
I have Coldfusion 9.0 running on a Windows Server 2008 R2. I recently installed the APSB12-06 security update (yes, I followed the right set of instructions specific to my installation). Since then, one of the automatic services we have in our web application fails to work on some systems, mainly users running Internet Explorer. We have an automated email that goes out to users to review artwork. They click on the link in this email, which sends them to a page to review their artwork. However, there is an intermediate step between, where it automatically logs in the user in before sending them to the artwork review page. It logs the user in, sets session variables, and then uses cflocation to send them to a artwork review page, including URL variables:
<cflocation url="dspReviewArtProof.cfm?OLID=#URL.OLID#&IID=#URL.IID#" addtoken="no">
The execution goes like this: link in email -> dspMyAccount.cfm (logs them in, sets the cflocation tag) -> dspReviewArtProof.cfm. The above code is located on the intemediate dspMyAccount.cfm page.
In the past, this has ALWAYS worked. But now, since the installation of the security fix, some users get caught in this endless loop of the system trying to log them in, even after they successfully log in. So, I put a snippet of code that will pull the current URL on the dspMyAccount.cfm page, as well as the URL on the dspReviewArtProof.cfm page, so I can see the before and after URL as it is passed from page to page. What I've found is that when some users reach the dspReviewArtProof page, their URL looks like this:
http://www.thesite.com/dspReviewArtProof.cfm?
When it should look like:
http://www.thesite.com/dspReviewArtProof.cfm?OLID=1234&IID=12345
It looks like the variables are getting cut off for some reason. The URL, when it reaches the dspMyAccount.cfm page, is ALWAYS correct. It isn't until it reaches the dspReviewArtProof.cfm that it looses the URL variables (after the cflocation tag). I thought maybe it was a problem with cflocation, so I replaced that tag with the cfheader tag, setting the status code to 302:
<cfheader statuscode="302" statustext="Object Temporarily Moved" />
<cfheader name="location" value="dspReviewArtProof.cfm?OLID=#URL.OLID#&IID=#URL.IID#" />
This didn't seem to fix the problem. I'm completely stumped here...And the boss isn't liking the fact that I can't figure it out! But the only thing in our system that has changed was the installation of the security patch...Does anyone have any ideas? Any information would be GREATLY appreciated.
Thank you!Hey all,
I have Coldfusion 9.0 running on a Windows Server 2008 R2. I recently installed the APSB12-06 security update (yes, I followed the right set of instructions specific to my installation). Since then, one of the automatic services we have in our web application fails to work on some systems, mainly users running Internet Explorer. We have an automated email that goes out to users to review artwork. They click on the link in this email, which sends them to a page to review their artwork. However, there is an intermediate step between, where it automatically logs in the user in before sending them to the artwork review page. It logs the user in, sets session variables, and then uses cflocation to send them to a artwork review page, including URL variables:
<cflocation url="dspReviewArtProof.cfm?OLID=#URL.OLID#&IID=#URL.IID#" addtoken="no">
The execution goes like this: link in email -> dspMyAccount.cfm (logs them in, sets the cflocation tag) -> dspReviewArtProof.cfm. The above code is located on the intemediate dspMyAccount.cfm page.
In the past, this has ALWAYS worked. But now, since the installation of the security fix, some users get caught in this endless loop of the system trying to log them in, even after they successfully log in. So, I put a snippet of code that will pull the current URL on the dspMyAccount.cfm page, as well as the URL on the dspReviewArtProof.cfm page, so I can see the before and after URL as it is passed from page to page. What I've found is that when some users reach the dspReviewArtProof page, their URL looks like this:
http://www.thesite.com/dspReviewArtProof.cfm?
When it should look like:
http://www.thesite.com/dspReviewArtProof.cfm?OLID=1234&IID=12345
It looks like the variables are getting cut off for some reason. The URL, when it reaches the dspMyAccount.cfm page, is ALWAYS correct. It isn't until it reaches the dspReviewArtProof.cfm that it looses the URL variables (after the cflocation tag). I thought maybe it was a problem with cflocation, so I replaced that tag with the cfheader tag, setting the status code to 302:
<cfheader statuscode="302" statustext="Object Temporarily Moved" />
<cfheader name="location" value="dspReviewArtProof.cfm?OLID=#URL.OLID#&IID=#URL.IID#" />
This didn't seem to fix the problem. I'm completely stumped here...And the boss isn't liking the fact that I can't figure it out! But the only thing in our system that has changed was the installation of the security patch...Does anyone have any ideas? Any information would be GREATLY appreciated.
Thank you! -
Hello all,
We have a problem using cflocation when trying to redirect
the user to a new cf page.
There is a file a.cfm contains an html form. Its action file
is b.cfm. In b.cfm, after processing the data received from a.cfm
the cflocation tag is used to redirect the user to c.cfm file. It
appears that from time to time, the execution is aborted before
redirecting the user to the c.cfm file.
No cookie is set up, no cfflush tag is used on the same page
as the cflocation tag is used.
We also tried to use in place of cflocation, the cfheader tag
like:
<cfheader statuscode="301" statustext="Moved
Permanently">
<cfheader name="Location" value="c.cfm">
<cfabort>
But we got the same acting.
In place, using the http refresh meta, seems to work.
Webserver: IIS on win 2003
Coldfusion: v. 7
Has anyone faced the same problem before?
Thanks,
Razvan Droscarucan you post your b.cfm code? it seems like there may be a
processing
condition or validation code that may prevent cflocation from
executing?
also look if there is anything in onRequestStart/End()
methods in
Application.cfc that might interfere, if you are using one...
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com -
cflocation after download complete
Is there a way to find out when a browser triggers the
download complete and then push the cflocation tag?
So when a download is complete and the page regains focus
that the page can change. Tried javascript but it only fires when
the page originally gets focus and cancels the download - also
tried a javascript setTimeout - it also starts counting when the
page loads and stops when the page loses focus.found the answer. What you do is you put the following code
in the <cfform>.
<cfform name="mod" action="modify.cfm" method="post"
onsuccess="ColdFusion.Layout.getBorderLayout(TAB NAME
HERE)"> -
CFLOCATION not passing URL variable
I have a simple CFLOCATION redirecting to a page with a fixed value of 15 as id
<CFLOCATION URL="http://www.MYWEBSITE.com/index.cfm?id=15">
When I hit the page locally it works fine, the receiving page can see the value of 15 in id.
However, when I run the same page on the server I get an error that the url.id does not exist
Not sure what is causing this, could it be a config issue in the CF admin?
Thanks
MarkJust after posting this I managed to find some sort of resolution to the problem, but it does concern me that this issue could be on other sites now. I found a link that suggested if a session was set and the cflocation was used all within one page then problems with variables could occur
http://helpx.adobe.com/coldfusion/kb/missing-session-variables-using-cflocation.html
I do have an application.cfm that sets a session, and when I hit the page the user does go right to the cflocation at the same time.
I placed an empty application.cfm into the directory so that it did not go one level up and set the session from the main application.cfm and now the variable does indeed pass through.
What I can't understand is why it works locally but not on the server
Anybody have any other input for this problem?
Maybe you are looking for
-
Adobe Creative Cloud App does not show downloaded apps and shows "download error"
I am not a full paying member just yet, and have been using Photoshop on trial for my graphic design courses. With the app, instead of showing me that my 30 day trial is over, I get a download error and contact customer support message. I have comple
-
Trying to Port Forward Airport Extreme 802.11ac using Airpot Utility 6.3.2
Hello kind experts. I am finally getting around to replacing my old BEFSR81 Cisco Router with an old Time Capsule attached with the Airport Extreme 802.11ac. The BEFSR81 also had 8 ports, so I have 8 hardwired locations throughout the house. I have
-
I was hoping to get a little expert advice on the system that I am planning on building. I was looking at picking up the "MSI Z68A-GD80 (B3)" motherboard, along with an Intel 510 SSD 120 gb drive. I am planning on partitioning the SSD into two drives
-
Increasing memory used by java process when calling Runtime.exec()
Hi everyone! I'm running a servlet Oracle iAS 9i, Jserv. It receives an image posted by a user and does a System.exec() which performs a call to convert (an image processing utility included in ImageMagick). After a few hours, java process start taki
-
I'm a noob. I just got an airport express for christmas (i love it). I would like to put it in my room (in client mode), and have another cheap router broadcasting the ethernet signal to it to repeat (WDS). Now, I know that apple says this can't be d