I have an application built using Angular JS.
It has 3 views say (A, B and C).
This is how I have configured the route params.
.config(function ($routeProvider){
$routeProvider
.when('/',{
controller:'aController',
templateUrl: 'jsps/a.jsp'
})
.when('/b',{
controller:'bController',
templateUrl: 'jsps/b.jsp'
})
.when('/c',{
controller:'cController',
templateUrl: 'jsps/c.jsp'
})
.otherwise({redirectTo:'/'});
});
All three views have Login Link. Clicking on LogIn will redirect the user to a different page within my application.
The Login is a form, which calls the LoginServlet and on successful authentication I am redirecting the user to my application.
RequestDispatcher rd = request.getRequestDispatcher("index.jsp");
rd.include(request,response);
I also tried with rd.forward(request, response)
index.jsp is the default page which has ng-view.
So by default always view A is loaded after authentication.
Now my situation is when the user is requesting login from B or C, he has to be redirected to that view after authentication.
I have tried request.getRequestDispatcher("index.jsp#/B");
But this doesn't work.
Any suggestions on how this can be achieved?