java - Spring MVC in conjunction with angular vanishing view -
i try connect springmvc, apache tiles, angular , boostrap. after typing: http://localhost:8080/testrest
menu appears bootstrap, table in appear videos , not pass second gets white screen.
check video here: https://youtu.be/v9fvl0yuwxu
rest returns data, it's ok.
code angularjs: https://github.com/giecmarcin/[...]/main/webapp/web-inf/static/js
view file: https://github.com/giecmarcin/[...]b-inf/pages/moviemanagment.jsp
restcontroller:
package com.springapp.mvc.controller; import com.springapp.mvc.entities.movie; import com.springapp.mvc.services.movieservice; import org.springframework.beans.factory.annotation.autowired; import org.springframework.http.httpstatus; import org.springframework.http.responseentity; import org.springframework.stereotype.controller; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.requestmethod; import org.springframework.web.bind.annotation.restcontroller; import java.util.list; /** * created marcin on 19.04.2016. */ @restcontroller public class movierestcontroller { @autowired movieservice movieservice; @requestmapping(value = "/movies/all", method = requestmethod.get) public responseentity<list<movie>> listallmovies() { list<movie> movies = movieservice.findall(); if(movies.isempty()){ return new responseentity<list<movie>>(httpstatus.no_content);//you many decide return httpstatus.not_found } return new responseentity<list<movie>>(movies, httpstatus.ok); } } kontroler zwracajÄ…cy widok @controller public class indexcontroller { @requestmapping("/") public string index() { return "index"; } @requestmapping("/testrest") public string gettest(){ return "moviemanagment"; } }
thank help.
Comments
Post a Comment