Basically the problem is related to the path ui-router redirects when page is reloaded.
I have java application with context kiosk-ui so the url is: http://localhost:8080/kiosk-ui
.
The client side is implemented using angularjs and for url management i use angular-ui-router. Application is single page app so i have states.
This is the configuration of the ui-router.
.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state("rewards", {
url: "/",
controller: 'RewardsCtrl',
templateUrl: 'templates/reward-selection.tpl.html'
})
$urlRouterProvider.otherwise("/");
})
On initial load of the page, i'm redirected to http://localhost:8080/kiosk-ui/#/
but when i refresh the page router redirects me to http://localhost:8080/#/
. So somehow it skips the webapp context path.
I tried to configure the router different way , so i will post that scenario as well.
.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state("rewards", {
url: "/kiosk-ui",
controller: 'RewardsCtrl',
templateUrl: 'templates/reward-selection.tpl.html'
})
$urlRouterProvider.otherwise("/kiosk-ui/");
})
On initial load of the page i'm redirected to http://localhost:8080/kiosk-ui/#/kiosk-ui
.
When i refresh the page it still redirects me to the same url but it's not what i want.
I want to have http://localhost:8080/kiosk-ui/#/
and when refreshed to stay there...
Thanks in advance