mardi 30 mai 2017

no display ng-include app java spring mvc

These are my files when loading index and cabecera does it well, but when running the ng-include does not load anything. Thank you

index.jsp

<body ng-controller="index">
    <ng-include src="'cabecera'"></ng-include>
    <div ng-view=""></div>
    <ng-include src="'pie'"></ng-include>
</body>

PreguntasController.java

@RequestMapping(value = "/index")
public ModelAndView index() {
    ModelAndView mv = new ModelAndView();
    mv.setViewName("index");

    return mv;
}

@RequestMapping(value = "/cabecera")
public ModelAndView cabecera() {
    ModelAndView mv = new ModelAndView();
    mv.setViewName("cabecera");

    return mv;
}

@RequestMapping(value = "/pie")
public ModelAndView pie() {
    ModelAndView mv = new ModelAndView();
    mv.setViewName("pie");

    return mv;
}

Navigator (localhost:8080/preguntas/index):

<!DOCTYPE html>
<html>
    <head>
        <title>Preguntas</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="shortcut icon" href="recursos/imagenes/ico/favicon.png">
        <link rel="stylesheet" href="recursos/css/bootstrap.min.css">
        <link rel="stylesheet" href="recursos/css/styles.css">
        <!--[if lt IE 9]>
        <script src="http://ift.tt/1fK4qT1"></script>
        <script src="http://ift.tt/19158cF"></script>
        <![endif]-->
        <script src="recursos/js/jquery.min.js"></script>
        <script src="recursos/js/bootstrap.min.js"></script>
        <script src="recursos/js/custom.js"></script>
        <script src="recursos/js/angular.min.js"></script>
        <script src="recursos/js/angular-route.min.js"></script>
        <script src="recursos/js/script.js"></script>
    </head>
    <body ng-controller="index">
        <ng-include src="'cabecera'"></ng-include>
        <div ng-view=""></div>
        <ng-include src="'pie'"></ng-include>
    </body>
</html>

index

Navigator (localhost:8080/preguntas/cabecera):

    <div class="header navbar-fixed-top">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <!-- Logo -->
                    <div class="logo">
                        <h1><a href="index.html">Preguntas</a></h1>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="page-content">
        <div class="row">
            <div class="col-md-2">
                <div class="sidebar content-box" style="display: block;">
                    <ul class="nav">
                        <li class="current"><a href="index"><i class="glyphicon glyphicon-home"></i> Inicio</a></li>
                        <li><a href="logout"><i class="glyphicon glyphicon-list"></i> Salir</a></li>
                    </ul>
                </div>
            </div>

cabecera




Aucun commentaire:

Enregistrer un commentaire