Code example for AbstractController

0
/** 
 * Controller for showing what's currently playing. 
 * 
 * @author Sindre Mehus 
 */ 
public class NowPlayingController extends AbstractController { 
 
    private PlayerService playerService; 
    private StatusService statusService; 
    private MediaFileService mediaFileService; 
 
    @Override 
    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { 
 
        Player player = playerService.getPlayer(request, response); 
        List<TransferStatus> statuses = statusService.getStreamStatusesForPlayer(player); 
 
        MediaFile current = statuses.isEmpty() ? null : mediaFileService.getMediaFile(statuses.get(0).getFile()); 
        MediaFile dir = current == null ? null : mediaFileService.getParentOf(current);