I have an error page,anyError.cfm, that looks like this
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
</head>
<body>
<p>An error has occurred.</p>
</body>
</html>
In the CF web admin under Server Settings > Settings > Site-wide Error Handler I enter \anyError.cfm. When I navigate to http://localhost:8500/some-url-that-doesnt-exist I still get the default error page. So my question, how do I get a custom site-wide error page using CF9? It doesn't necessarily have to be through the web admin.
Edit:
Try using the value "anyError.cfm" instead of "\anyError.cfm" in the site-wide error handler setting.
Update, after seeing your update to your question I see now that you are generating a 404. Which is not for the site-wide error handler, it is for the missing template handler setting right next to it.
Try using a variable that doesn't exist instead to generate an error that will cause the site-wide error handler to display.
Related
I am trying to get cloudflare stream to work in angular. I have tried the solution given here: Angular attribute for HTML stream.
However, it is always a hit or a miss:
Out of 10 reloads, one loads the player.
But anytime I make a
change to the <stream> tag, and angular re-compiles, the player is
loaded. After this if I refresh the browser, it is a blank screen
again.
The component which shows the video is deep in the tree and the component belongs to a module that is lazy loaded:
In the index.html file:
<!doctype html>
<html lang="en">
<head>
...............
</head>
<body>
<app-root></app-root>
</body>
<script src="https://embed.cloudflarestream.com/embed/r4xu.fla9.latest.js" id="video_embed" defer="" async=""></script>
</html>
In the videoFile.component.ts:
<stream src="5d5bc37ffcf54c9b82e996823bffbb81" height="480px" width="240px" controls></stream>
Found a solution here: https://github.com/angular/angular/issues/13965
So everytime the component loads, the script is removed and reattached using ngOninit, like so:
document.getElementById("video_embed").remove();
let testScript = document.createElement("script");
testScript.setAttribute("id", "video_embed");
testScript.setAttribute("src", "https://embed.cloudflarestream.com/embed/r4xu.fla9.latest.js");
document.body.appendChild(testScript);
If anyone has any other solutions, please do let me know.
I am trying to embed an AWS Quicksight dashboard into our application but I am having some trouble with the embed process. The URL has been generated correctly and but I get a permission denied error when I attempt to embed it.
I am able to load the generated URL directly in a new tab but when I attempt to embed it I get a 401 error.
I have whitelisted the domain in the Quicksight console and am accessing the page over HTTPS. The complete test page is shown below.
The following code is what I am using to test embedding. It was taken from an Amazon example.
<!DOCTYPE html>
<html>
<head>
<title>My Dashboard</title>
<script src="https://unpkg.com/amazon-quicksight-embedding-sdk/dist/quicksight-embedding-js-sdk.min.js" ></script>
<script type="text/javascript">
function embedDashboard() {
var containerDiv = document.getElementById("dashboardContainer");
var params = {
url: "<link that works in a standalone browser tab>",
container: containerDiv,
parameters: {
},
height: "700px",
width: "1000px"
};
var dashboard = QuickSightEmbedding.embedDashboard(params);
dashboard.on('error', function(err) {console.log('dashboard error:', err)});
dashboard.on('load', function() {});
}
</script>
</head>
<body onload="embedDashboard()">
<div id="dashboardContainer"></div>
</body>
</html>
Amazon sends a 302, followed by a 401. Which results in a frame with the error message "We can't display this page (Not Authorized).
The first request in the image fetches a fresh link from the server and the subsequent two are the framing attempt.
I would expect that if something was wrong with my authorization then a loading the link in it's own tab would not work. I think the issue must be with the frame but don't know what other options to check beyond the whitelist.
Does anyone have any idea what else I can try?
This is a single script.php only to load data.
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>TEST</title>
</head>
<body>
<div id="location">
<script src="https://maps.googleapis.com/maps/api/geocode/json?latlng=42.149247222222,24.752305555556&key=My-enabled-key-here">
</script>
</div>
</body>
</html>
In Mac Safari I get I get `SyntaxError: Unexpected token ':'. Parse error.
Several data is loaded I see it in Safari debugger starting in:
but I cannot use it because of that error message.
In Chrome and Opera I get Cross-Origin Read Blocking (CORB) blocked cross-origin response with MIME type application/json.
Reading some old questions I added
<?php header('Access-Control-Allow-Origin: http://example.com') ?>
and then replaced by
<?php header('Access-Control-Allow-Origin: *') ?>
as the first line but nothing changed.
From Google side: Key restrictions
-> Application restrictions: none.
-> API restrictions: yes (key is accepted for 4 APIs, one of them is Geocoding API
What's wrong here?
Since you are making a Geocoding web service request in the client-side (front-end) that's why you are getting the Cross-origin blocking error (CORB). Web service requests are meant to be executed server side.
Note that if you intend to use Geocoding in client-side, the JavaScript API has a Geocoding Service (which prevents the CORB issue). Please refer to this guide: https://developers.google.com/maps/documentation/javascript/geocoding
Hope this helps!
Im trying to implement oauth1 for quickbooks, using a python library requests_oauthlib. My problem is i tried setting up the quickbooks oauth as suggested by quickbooks inserting the quicbooks button.
The sample code provided was:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ipp="">
<head><meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-1">
<title>My Connect Page</title>
<script type="text/javascript" src="https://appcenter.intuit.com/Content/IA/intuit.ipp.anywhere-1.3.2.js">
</script>
<script type="text/javascript">
intuit.ipp.anywhere.setup({
grantUrl: 'http://www.mycompany.com/HelloWorld/RequestTokenServlet'
datasources: {
quickbooks : true,
payments : false
},
paymentOptions:{
intuitReferred : true
}
});
</head>
<body>
<ipp:connectToIntuit></ipp:connectToIntuit>
</body>
</html>
But what it does is, it opens a new pop up like window and goes through the oauth process, but i am not able to figure out, how to get the control back to my app when the redirect happens to the redirect url mentioned, with the access token. Now the redirect url is also opened within the pop up window.
But what it does is, it opens a new pop up like window and goes through the oauth process,
This is expected behavior. This should happen. The entire OAuth process takes place within the pop-up.
Now the redirect url is also opened within the pop up window.
It should be, this is good.
All you have to do is use window.close() to close the pop-up once the OAuth process completes.
I'm trying to run a very simple app to the new WSO2 AppServer (version 5.0.0) but there seems to be something very odd going on. When I try to access a page that does a simple JNDI lookup, I get the following error:
HTTP Status 500 - org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error:
Only a type can be imported. javax.naming.InitialContext resolves to a package
An error occurred at line: 11 in the jsp file: /jndi.jsp
Generated servlet error: InitialContext cannot be resolved to a type
An error occurred at line: 11 in the jsp file: /jndi.jsp Generated servlet error:
InitialContext cannot be resolved to a type
The page contains just the following code:
<!DOCTYPE html>
<%#page contentType="text/html" pageEncoding="ISO-8859-1"%>
<%#page import="javax.naming.InitialContext" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>JNDI Test</title>
</head>
<body>
<h1>JNDI Test</h1>
<%
InitialContext ctx = new InitialContext();
%>
<p>Context: <%= ctx.getNameInNamespace() %>
</body>
</html>
It seems that the tomcat compiler is unable to "see" the java runtime classes, but I can't figure out why.
Any help would be appreciated.
Add the jndi look up code to a seperate java class and invoke it from your jsp page.