1

I have created some rest web services which will be consumed by mobile application. Rest web services are designed in spring boot with @RestController. I want to access this access this rest apis from static html page and want to redirect to other html pages.

For example: I have static html page /src/main/static/login.html from which I am calling rest web service "http://localhost:8080/login" and when login details verified I want to redirect it to other static html page /scr/main/static/view.html

how can I achieve this. ?

Please help, thanks in advance.

Harsh
  • 11
  • 2
  • If what you need is securing your API, then it would be better to import spring-boot-security-starter and define your security, as it is described in this tutorial: https://spring.io/guides/gs/securing-web/ Then you will need to call your api directly, eg. /view, and as soon as you're not authenticated, Spring will handle the redirection to login page and back. – bart.s Mar 04 '17 at 17:54
  • this link should be useful, http://www.baeldung.com/spring-redirect-and-forward, https://stackoverflow.com/questions/29085295/spring-mvc-restcontroller-and-redirect , https://stackoverflow.com/questions/9311940/redirect-to-dynamic-url-in-spring-mvc – Dusman Sep 10 '17 at 05:55

0 Answers0