Package com.logigear.spring.mvc.models

Examples of com.logigear.spring.mvc.models.Movie


    public String loadMovie(@PathVariable int id) {
        UserInfo userInfo = (UserInfo) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        int count = userInfo.getAuthorities().size();
        SimpleGrantedAuthority[] authorities = new SimpleGrantedAuthority[count];
        userInfo.getAuthorities().toArray(authorities);
        Movie movie = moviesService.loadMovie(id);
        return "You are watching movie <b>" + movie.getMovieName() + "</b> - [logged in as <b>" + userInfo.getUsername() + ", " + userInfo.getLastName() + "</b>]";
    }
View Full Code Here


   
    @Override
    @PreAuthorize("hasRole('ROLE_USER')")
    @PostAuthorize("isOver18(getReturnObject())")
    public Movie loadMovie(int movieId) {
  Movie movie = new Movie();
 
  movie.setId(1);
  movie.setMovieName("Ao lua Ha Dong");
  movie.setMovieType(MovieType.Adult18plus);
  return movie;
    }
View Full Code Here

TOP

Related Classes of com.logigear.spring.mvc.models.Movie

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.