search

Home  >  Q&A  >  body text

angular.js - How to configure url in springMVC and angular's ui-router?

As shown in the picture, when entering this page, it should be http://localhost:8020/home, but under the control of ui-route routing, after the function list is displayed, the address is http:/ where home becomes the function list. /localhost:8020/functio….

So, at this time, if you refresh the page http://localhost:8020/functio...
in the browser, 404 will appear.

Indeed, because in springMVC, there is no functionManagement page in view parsing. functionManagement is just a home view under the control of ui-router.

How to solve this problem?
When refreshing, instead of showing 404, can you display the home page?

世界只因有你世界只因有你2812 days ago681

reply all(3)I'll reply

  • PHPz

    PHPz2017-05-15 17:08:42

    Your front-end should be a single-page application, right? The back-end routing only needs to point to this single page, and the rest of the routing is controlled by the front-end.

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-15 17:08:42

    It is recommended to separate the front and backend. The backend only provides data, and the frontend routing is only responsible for the view layer

    reply
    0
  • ringa_lee

    ringa_lee2017-05-15 17:08:42

    Written the route on the front end, and then jump to the corresponding route on the back end

    reply
    0
  • Cancelreply