how to create url like example.com/account in gwt application - url

I need to create a few urls which for my gwt application. e.g currently login screen is
http://127.0.0.1:8888/abc.html?gwt.codesvr=127.0.0.1:9997
http://example.com/abc.html?gwt.codesvr=127.0.0.1:9997
i want to change it to
http://127.0.0.1:8888/accounts
http://example.com/accounts
so when user directly open this link
I have developed this applicatoin in gwt with jdbc
looking forward to your reply

I suggest you take a look at how GWT handles History. You can save states of your application by using History tokens(For ex: ../modulename#user1, ../modulename#user2) and by parsing these tokens you can direct your user to appropriate section of your application. Since GWT applications run on a single html page I beleive this would be the correct approach to implement your functionality. Last but not least these states are bookmarkable and supports browsers back button as well.
By the way about changing the Url, ?gwt.codesvr=127.0.0.1:9997 is added to the url in development mode and will not appear in production mode when you compile deploy your application.

Just create a subfolder named accounts and move the index.html file there. The webserver should not automatically serve the index.html file, when someone requests to see the folder.

You can create the history and add the token in them:
private static final String abc = "account";
History.newItem(abc ,true);

Related

TYPO3 8.7 is it possible to output a specific page with multiple url path s

I'm trying to integrate a vue.js application into a typo3 page.
I have a full functional TYPO3 instance where I can create own pages, edit the content and more. Now I want to add an existing vue.js application within this page.
Therefore I created an extension which added all necessary resources (js, css) and added an own content type which controls the integrations and configurations. The content type outputs a vue.js entry point. So far everything works. Smaller vue.js applications works as they should.
Now comes the challenge: When I want to create a more complex application which relies on the router functionality, I run into a problem.
Let's assume, I integrate my application into the page /shop and my application tries to render a product under /shop/product/some-id. This doesn't work. The URL processing is done by TYPO3 (as designed).
I tried to find a solution within the documentation but I'm not sure what I should search. I need a way to output the same page (/shop) regardless the following path. Does someone have a hint?
I found a solution. Within TYPO3 v8 is it possible to use the realurl extension for this purpose.
It is possible to define an own decode preprocessing function and analyse the current url.
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['decodeSpURL_preProc'][] = RealUrlManipulation::class . '->decodeSpURL_preProc';
Within this method is it possible to change the url for TYPO3 inner processing and set it to an known url.

Add a static website from Azure Storage Account to an Asp.net MVC app?

I have to include a React application inside a dotnet MVC project. I have a simple React application that only contains a KendoUI grid.
I did a build of the React application and uploaded it as a static website using Azure Storage Account.
I then created an Azure CDN that points to the static React application
Here is what I need to do:
I have the following code (ASP.net MVC):
The commented div is the div that contains the old grid (the one to be replaced with the static React application).
I would like to add the static React application in the test div (the one with the id "scheduleSitesGrid2")
I configured my static React app to look for that exact same div (here is the index.tsx):
That being said, is there a way I can easily include that react application in the MVC app using Azure CDN? I could not find any other question regarding adding a React app to MVC using CDN.
I tried to include the CDN in a script tag, but that did not work. I am also wondering that since the React app is hosted as a static site, it is already built, so I might not be able to add it in the MVC div (since it is already inserted into the index.html file of the React app as shown in the following picture). I would then need to upload all the app to Azure besides the index.html. Am I right?
Thank you very much!
Peace!
If I understand correctly you have an MVC Web App hosted using some App Service Plan, and a React application which has no server side code execution just Javascript?
If that's correct then you will certainly be serving content from two separate domains: One for your Web App, presented via CDN; and one for the storage account, hosting the static content, which is only presented via the storage account URI.
The both can indeed be presented via a single CDN endpoint, but you would need to use the premium tier and make use of URL rewrite rules. You would have your default route configured to that of your Web App URI, then you would configure a rewrite rule to, for example, rewrite (translate) "/static/..." to "https://{{yourstaticstorage}}.storage.azure.com/yourstaticpath/...".
Verizon Premium rewrite is documented here: https://learn.microsoft.com/en-us/azure/cdn/cdn-verizon-premium-rules-engine-reference-features#url-rewrite
If you don't want to use Verizon Premium, you could also take a look at Azure Front Door.
https://azure.microsoft.com/en-gb/services/frontdoor/
Essentially, Front Door is CDN on steroids. It has built in WAF and allows you to configure routing rules. Do compare the pricing before going this route as I'm fairly sure you have to pay for each routing rule.
You could also pull the static content in code before delivering it but this wouldn't be cached on the CDN since every dynamic page visited would require execution. You're better off creating a routing rule and using relative paths to the static content which are retrieved and cached by the CDN / Front Door.

How to configure a site so that I can have a url without directory the way Wordpress did?

Say I made a website with Wordpress, and created a few pages say www.foo.com/bar1 and www.foo.com/bar2. I have no idea where they stored this, since there is no /bar1 and /bar2 directory. Unlike when I created a site from scratch and added new directories like /public_html/bar1.
So how do I configure it like this without Wordpress?
It depends on the technology\framework you're using. Google 'Routing'.
Example for Asp.Net: https://msdn.microsoft.com/en-us/library/cc668201.aspx
When you create a page using WordPress, your all page will have a dynamic content with same layout from page.php file which is a mandatory file of a theme and served according to the routes. You will not see the page.php in URL or page. WordPress saves your page title in database and servers it accordingly (check the permalink section of WordPress).
When you create a custom site from scratch you can do the same by creating a file and re-use it according to the routes. You don't need directory for that.
Note: File extensions like .php .html are removed using .htaccess file.
Maybe you can use a framework like ZK framework to create a div content and refresh it according to the request. This way, you may not have to update any url in your application. You just refresh an inner div by dynamicaly including a new view.
Maybe this would help:
https://www.zkoss.org/wiki/ZK_Component_Reference/Essential_Components/Include

How to reduce worklight application url to shorter form?

How to reduce Worklight application url?
For ex: My application url is //hostname:ipaddress/projectName/apps/services/preview/projectNameApp/common/0/default/projectNameApp.html"
How to reduce this url to shorter form?
I want to set up a url which can be accessible easily over the internet.
what are the settings required to get shorter url in worklight project
For ex
//hostname:portno/context path/appIndexPage.html
instead of
//hostname:ipaddress/projectName/apps/services/preview/projectNameApp/common/0/default/projectNameApp.html"
Thanks.
May I know the purpose? These URLs are not meant for public (end-user) consumption; they are internal.
However,
If you are aiming to use the Mobile Web environment, meaning you take the public URL of the app from Worklight Console and place it in your mobile web site for users to access, there is the option to use bit.ly to shorten the URL; you will first need to create an account at http://bit.ly.
This is not the URL of your all. This is the URL of the app PREVIEW. Moreover, this is preview of common environment. If you're targeting mobile/desktop web environment - add it to your project and then use WL console to generate short link.

symfony: change application dir

I have ordinal symfony project which includes 2 applications: public and admin parts.
I need to move admin application files to project_path/web/admin. So if I call www.project.com/admin the admin project will be shown.
How should I configure project to allow that ?
Moving an app to the document root would create a security hole since ALL your app files would be accessible to anyone if you don't secure them in any way. If you do not like the default symfony project setup which uses url rewriting for a single app only (the public one ususally) and want to have "clean urls" in other apps as well, you can create subdomains for them and set the "no_script_name" parameter in settings.yml to "on". For example, this way you could have urls like http://myap.domain.com/nice/url/here. In your case, the public app could be on domain.com and the admin app on admin.domain.com. Of course, you would have to configure your Apache vhosts accordingly - this is not something that symfony does for you out of the box.
Definitely do NOT move your files into web/admin
A solution to your problem will very likely be found in the project_path/apps/frontend/config/routing.yml
I had a similar problem before. I created a frontend module and called it "admin" then put links in it that linked to myproject/backend.php/table etc....
you can use the routing file to make www.project.com/admin work
to learn more: http://www.symfony-project.org/book/1_2/09-Links-and-the-Routing-System
remember to enable module_rewrite in you http.conf

Resources