package org.dcsc.athena.controllers;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;

import org.springframework.messaging.simp.SimpMessageHeaderAccessor;

@Controller

public class TutoringIndexController {

    @RequestMapping("/tutoring/athena")
    public String getTestPage(Model model, HttpServletRequest req) {

    	Authentication auth = SecurityContextHolder.getContext().getAuthentication();
      	String name = auth.getName(); //get logged in username
      	
      	if (name.equals("anonymousUser")) {
  			model.addAttribute("loggedIn", false);  
  			model.addAttribute("notLoggedIn", true);

      	} else {
  			model.addAttribute("loggedIn", true);
  			model.addAttribute("notLoggedIn", false);  

      	}

      	model.addAttribute("hostname", req.getRemoteHost());
      	model.addAttribute("username", name);
      	model.addAttribute("requestsCompleted", 42);

        return "athena/index";
    }
}

@@ -657,17 +657,20 @@
  %7B%0A%0A    
-%09
+    
 Authenti
@@ -745,17 +745,18 @@
 ;%0A      
-%09
+  
 String n
@@ -806,278 +806,88 @@
 ame%0A
-      %09%0A      %09if (name.equals(%22anonymousUser%22)) %7B%0A  %09%09%09model.addAttribute(%22loggedIn%22, false);  %0A  %09%09%09model.addAttribute(%22notLoggedIn%22, true);%0A%0A      %09%7D else %7B%0A  %09%09%09model.addAttribute(%22loggedIn%22, true);%0A  %09%09%09model.addAttribute(%22notLoggedIn%22, false);  %0A%0A      %09%7D%0A%0A      %09
+%0A        model.addAttribute(%22loggedIn%22, !name.equals(%22anonymousUser%22));%0A        
 mode
@@ -933,33 +933,34 @@
 eHost());%0A      
-%09
+  
 model.addAttribu
@@ -991,9 +991,10 @@
     
-%09
+  
 mode

Remove redundant attribute `notLoggedIn`