Start app in a web flow - spring-webflow

I am using spring web flow 2.
I want that my first page to be one of a flow. How can I do that? I tried to set the welcome-file but it doesn't work.
Any ideas?
Thanks,
Luisa

You can place the following index.html in the root of your webapp (next to WEB-INF) according to 'spring booking' test app that goes with Webflow distro:
index.html:
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=spring/startFlowName"/>
</head>
</html>

Related

Google One Tap UI Not Showing

I am trying to show Google One Tap UI on a barebone template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://accounts.google.com/gsi/client" async defer></script>
</head>
<body>
<div id="g_id_onload"
data-client_id="00000-xx000rrr.apps.googleusercontent.com"
data-context="signin"
data-login_uri="https://example.com/login/"
data-auto_select="true">
</div>
</body>
</html>
It showing nothing! I tried on incognito, configured oauth consent screen and whitelisted the localhost domain (with ssl).
What am I missing here?
As is this will automatically log in a user that has given consent to your app. If anything you'll see a popup that says signing in.
What you need is to include the HTML for the button to show up. Like this
<div class="g_id_signin"
data-type="standard"
data-shape="rectangular"
data-theme="outline"
data-text="signin_with"
data-size="large"
data-logo_alignment="left">
</div>
Also it won't work at all over http, the site has to be https.
you can check here for a generator
https://developers.google.com/identity/gsi/web/tools/configurator
As a simple first test, you might try using a callback and console.log() to output the credential. Then add your back-end server into the mix once you're happy with the UI and confirm your understanding of the sign-in flow.
Incognito mode is the best way to ensure you've not accidentally triggered the exponential cooldown timer.
Visit https://myaccount.google.com/security, Signing in to other sites to find your app, revoke it's permissions to reset the sign-in flow, and to confirm the global opt-out is enabled.
Removing data-auto_select will display the One Tap popup, including it will instead show the automatic sign-in prompt on return visits.

Check dynamic web page is modified

I want to check if page https://m.nn.ru/f/1238 has been updated periodically.
I ran
curl https://m.nn.ru/f/1238 | head -c 4096
And it's output is below:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="1;url=https://passport.ngs.ru/check/?name=ngs_token&return=http%3A%2F%2Fm.nn.ru%2Ff%2F1238" />
<title>Redirecting to https://passport.ngs.ru/check/?name=ngs_token&return=http%3A%2F%2Fm.nn.ru%2Ff%2F1238</title>
</head>
<body>
Redirecting to https://passport.ngs.ru/check/?name=ngs_token&return=http%3A%2F%2Fm.nn.ru%2Ff%2F1238.
</body>
</html>
So I am redirected to login page and brought back to m.nn.ru/f/1238
When I open m.nn.ru/f/1238 in browser it doesn't show the redirection link but the contents of m.nn.ru/f/1238 (though I am not logged in and I think there are no cookies set)
How to get the contents of https://m.nn.ru/f/1238 ?
Another alternative is to use https://nn.ru/community/hobby/advance which has a 301 redirect
I found a workaround. I installed elinks text-mode browser and save the page:
elinks https://m.nn.ru/f/1238 > 1

OG tags not working with react-helmet and Netlify

I cannot for the life of me figure this out. The following site is hosted on Netlify and prerendering is enabled. When inspecting the page, all of the OG tags are correct. These tags are injected using react-helmet.
https://browniepoints.africa/opportunities/volunteer-at-a-soup-kitchen-every-week-on-thursdays
When scraping the above URL on the Facebook debugger, it responds with:
The following required properties are missing: og:url, og:type, og:title, og:image, og:description, fb:app_id
The only one of those errors/warnings that should be there is the app_id, which I don't care about.
I've waited well over 48 hours for caches to clear, I've tried scraping with query strings appended to the URL, and the images have absolute URLs. But not even the description tag is pulling through.
Can somebody that uses react-helmet and Netlify please shed some definitive light onto this problem?
This is related to a known prerendering issue.
My fix was to remove the <!DOCTYPE html> declaration from the index.html file as a temporary workaround until the above issue is resolved.
While I can't tell you exactly why. your SSR is not working correctly. Go to Chrome DevTools and click the 3 vertical dots next to Console:
Select Networking Conditions, then uncheck Select Automatically and enter Googlebot/2.1 (+http://www.google.com/bot.html):
Now refresh the page and notice that all you see on the site is some plaintext saying "html" and even your javascript bundle is missing. This is what your html looks like:
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="fragment" content="!">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Brownie Points</title>
<link href="/static/css/2.3bf0f3c5.chunk.css" rel="stylesheet">
</head>
<body><noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
Note that Netlify SSR is in Beta but I personally didn't have those issues with it. Have you done any other steps other than enable it? I have tested it to be working with a CRA generated app before.

MVC - Serve an index.html + bundle.js created by react

my question may not be related to react directly and maybe related to MVC routes only but i decided to share the bigger picture if anyone thinks i'm on the wrong track.
we have a React / redux application that bundles to an index.html file with css and js resources:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8" />
<title>Booking Engine</title>
<link href="./main.837f1985001f2e603b8755f0f28be780.css" rel="stylesheet">
</head>
<body>
<div id="sb-be"></div>
<script type="text/javascript" src="./main.adb11750acf05df99619.js"></script>
</body>
</html>
the resources are dynamicly hashed as you can see.
I need to serve this index.html from a MVC application, i tried to do that using this post (by using MapPageRoute and RouteExistingFiles in RouteConfig).
I can serve the html as expected, though the resources are not being served correctly.
This is my file structure in my MVC app:
--MVCRoot
----Other MVC related folders
----ReactFolder
--------dist
------------index.html
------------main[hash].js
------------main[hash].css
now using a MapPageRoute like so:
routes.MapPageRoute("index", "SomeName/{*pathInfo}", "~/ReactFolder/dist/index.html");
The resource files of main.js and main.css are being served as the index.html, i mean i literally get the index.html instead of the actual js and css files.
I tried with routes.RouteExistingFiles set to true or false but no help.
EDIT: basically my question is how to serve a html static file with a "pretty" (custom) URL without interrupting the page's resources load with their relative path?

Twitter Helper with webmatrix issue. Displays blank page

I'm attempting to teach myself ASP.Net and I've decided to start with web pages so I'm going through the tutorial here
The problem I'm running into is that I can't get the Twitter helper to work. I just get a blank page and can't figure out what the issue is. I have checked to make sure the Twitter helper is installed and intellsense recognizes the TwitterGoodie methods. Here is my code...
#{
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>twittertest</title>
</head>
<body>
<div>
#TwitterGoodies.Search("webmatrix")
</div>
</body>
</html>
The package referenced in the article you linked to uses version 1.0 of the Twitter API which was deprecated in June 2013. Hence nothing appears on your page. If you want a Twitter widget to appear on a page, go and get one directly from them: https://twitter.com/settings/widgets/new

Resources