简体   繁体   中英

href not redirecting to corresponding page

I have a page with a couple navigation links in the following format, When i click on each of these links, they should redirect me to the corresponding jsp page..

How can i do this? Note that home, about and contact are jsp pages I have written..

Home About Us Contact Testimonials I am using AngularJS and JSP for the front end.

Currently, when I click on the links, the URL changes to the JSP page but the page doesn't reload. I am not sure how I can solve this.

<div id="navbar" class="collapse navbar-collapse">
    <ul class="nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="aboutus">About Us</a></li>
        <li><a href="contact">Contact</a></li>
        <li><a href="testimonials">Testimonials</a></li>
    </ul>
    <form class="navbar-form navbar-right">
        <ul class="nav navbar-nav">
            <li><a href="/login">login</a></li>
        </ul>
    </form>
</div><!--/.nav-collapse -->

If the link is changing that means the request is being made. This can be checked from Browser console as well. Please add debugger in controller code and check if the request is received by it.

If you are asking that question I assume that all your code works and displays correctly in browser and everything works excerpt links.

So if you are using HTML 5 mode enabled, all urls should start with #! prefix. For example, #!/login in your case.

If HTML 5 is disabled #/login should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM