The project is not configured for Facelets yet in RAD 8.0 - facelets

I am trying to create JSF 2 pages. When I create pages using facelets template I get message on top that "The project is not configured for Facelets yet.
You need to add a Facelets runtime to the project's classpath".
I created file called Test1.xhtml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11 /DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com /jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com /jsf/html">
<h:head>
<title>Test1</title>
<meta http-equiv="Content-Type"
content="application/xhtml+xml; charset=UTF-8" />
<meta name="GENERATOR"
content="Rational® Application Developer for WebSphere® Software" />
</h:head>
<h:body>
Test
</h:body>
</html>
When I run this I see same content of file in explorer, instead of Test.
Also Page code is not created for it.

Page code and required web.xml/facesconfig stuf is created when you drop first component on the page.
Check this: http://www-01.ibm.com/support/docview.wss?uid=swg21503733

Related

Tizen web app - Embedding <video> inside <iframe> works in emulator, but not on the actual TV

I have a simple Tizen webapp that works fine in emulator, but not on my Samsung signage TV (SSSP6).
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
<div class='embed-container'>
<iframe width="100%" height="100%" sandbox="allow-same-origin allow-top-navigation allow-forms allow-scripts allow-popups" src="https://ad-presenter-staging.herokuapp.com/betsonglobal"></iframe>
</div>
</body>
</html>
If I replace the <iframe> with an actual <video> with the same content as what's in src, then it works fine in both emulator and on the TV.
How do I go about debugging this?
It's very possible URL is blocked during access. try updating the config.xml => policy => allow-navigation or Access
with external URL domain you want to access.
If I replace the with an actual with the same content as what's in src, then it works fine in both emulator and on the TV.
=> Does it show any error when is used on TV? The info displayed in region should be helpful to debug.
How do I go about debugging this?
=> If you're able to connect the TV to your PC, you can try launching the webapp in debug mode. After launch, if you check console section in Web Inspector, it should be logging the URLs blocked and the reason for block which should aid in fixing

React application not running due to Content Security Policy

I have a build a React application and deployed it on Heroku. When I try to load my home page "/" I get no errors and the page loads perfectly. But when I try to navigate to a different page "/RegistrationList" I get the Content Security Policy errors:
I have already searched for a solution online and found that I need to specify a Meta tag in the index.html file inside the public folder of my application. So now this file looks as follows:
!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
http-equiv="Content-Security-Policy"
content="default-src * 'self' 'unsafe-inline' 'unsafe-eval'"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons"
/>
<link
href="https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght#0,400;0,700;1,400&display=swap"
rel="stylesheet"
/>
...
But at this point I still keep on getting the errors. The strange thing is that the main page ("/") loads perfectly and the second page gives these errors.
Your current CSP within the index.html is useless under a security point of view (you are allowing everything, so this is equivalent as not defining a CSP).
CSP can be defined either in your front-end (index.html) and back-end, and when there is a mismatch, you find all kinds of errors. If you try to remove the CSP meta tag from your index.html and you still get the error, it means the problem is in the server side.
In case of Apache server, this is located in file 'htaccess'. As for Heroku, I don't know exactly where it is. Perhaps this can work:
https://stackoverflow.com/a/57288001/10802411

Why won't AngularJS get invoked in Microsoft Dynamics CRM 2015 in IE11?

I set up a ribbon button to call an html page from my webresources. I add an example.html page with this code into webresources (taken from W3 schools):
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"> </script>
<body>
<div ng-app="">
<p>Input something in the input box:</p>
<p>Name : <input type="text" ng-model="name" placeholder="Enter name here"> </p>
<h1>Hello {{name}}</h1>
</div>
</body>
</html>
The example.html page will come up when clicked, but angularJS isn't being invoked for whatever reason, and {{brackets}} are still displayed as opposed to the angular variables and functions they represent. The exact same code definitely works in other html compilers I've plugged it into, why is this not working in Dynamics CRM, and how can I get angular to work with the html webresource pages I call?
Additional Info/Edit: https vs http has been suggested and has no bearing; actual page with angular.js script in webresource is also having same problem. Found out that this is only a problem in IE, specifically using IE11. Works as intended in Chrome and Firefox, but IE is what's supposed to be supported.
Figured it out! It works in Chrome/Firefox, which is great, but IE is our main customer base, so it's more of an IE issue than a Dynamics or JS issue. It's forced in doc-mode 5 via intranet compatibility settings, so I have to find a way to get it updated.
Fixed that by plugging this into the IIS web-config, so now everything works as expected. As a bonus, it's speeding up the loading time of CRM navigation by a lot for everyone as well!
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=edge" />
</customHeaders>
</httpProtocol>
</system.webServer>
Addendum
It's better with IIS 7 to add an 'X-UA-Compatible' tag in the http response headers options for your sites rather than manipulate the web config directly.
ALSO another part of the problem in IE and Dynamics CRM, is that after adding that tag, you're restricted to uploading html files directly for your web resources. If you upload one and try to make a simple change through the text editor, Dynamics itself will add its own meta 'x-ua-compatible ie=5.0000' tag that superimposes over your IIS changes, but this is ONLY if you go into text editor after the fact, so simple changes will have to be made to your html file locally and uploaded again.
It has something to do with IE opening the HTML web resource as using Document Mode as IE7 standards. IE reports this message in the console if you want to see it. I added the following to my web resource and it fixed the issue:
<!DOCTYPE html>
<html>
<head>
<title>My page</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
Two things:
You don't have a head tag (though most browsers probably handle this fine)
The script you're referencing is http instead of https (the real problem)
This works:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
</head>
<body>
<div ng-app="">
<p>Input something in the input box:</p>
<p>Name : <input type="text" ng-model="name" placeholder="Enter name here"></p>
<h1>Hello {{name}}</h1>
</div>
</body>
</html>

grunt serve VS opening index.html in browser

I'm using Yeoman and the angular-fullstack generator to bootstrap an angular app. When I do grunt serve or grunt serve:dist everything works as expected.
Now the question is, when I open the index.html file directly in the browser, isn't it supposed to work equally?
So I have a hard time understanding whats tasks grunt is executing here to make it work. Or maybe I am missing something else.
The console tells me:
GET file:///app/8d57a97f.app.css net::ERR_FILE_NOT_FOUND
GET file:///app/47ab0f3e.vendor.js net::ERR_FILE_NOT_FOUND
GET file:///app/01b9b8a8.app.js net::ERR_FILE_NOT_FOUND
The generated index.html looks something like this:
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<base href="/">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="app/8d57a97f.app.css"/>
</head>
<body ng-app="myApp">
<!-- some functionality... -->
<script src="app/47ab0f3e.vendor.js"></script>
<script src="app/01b9b8a8.app.js"></script>
</body>
</html>
The reason why I do this:
I try to run the angular app with phonegap on an android device. When I load it to the android mobile, the screen remains blank. So I opened it in the browser and got the same result.
So this is my first attempt to solve this issue.
The problem was the <base href="/"> in the header.
Explanation can be found here (Loading local file in browser referenced css or js).

CakePHP displaying "admi" at the top of any page

I'm trying to deal with some strange CakePHP behaviour. I enabled "admin" prefix in core.php and now I have "admi" at the top of any page...
admi<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
Literally out of nowhere, no trace of it in layout # default.ctp.
Looks like some CakePHP bug, any ideas would be appreciated.
Running on localhost, Apache 2.2.17, PHP 5.3.5, MySQL 5.1.63, Cake 2.o
Found it, "admi" was at the beginning of core.php, I probably added it accidentally when I was changing "admin prefix" there.

Resources