package com.javahonk.controller;

import java.io.File;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
public class SpringMVCController {
	
	private static final Logger logger = Logger.getLogger(SpringMVCController.class);
	
	@RequestMapping(value = "/firstPage")
	public String firstPage(ModelMap model) {
		
		logger.info("Log4j info is working");
		
		String path = Thread.currentThread().getContextClassLoader().getResource("Sample.xml").getPath();
		File file = new File(path);
		String absoluteFilePath = file.getAbsolutePath();
		System.out.println(absoluteFilePath);
        model.addAttribute("message", "Spring MVC RESTFul Service");
		
		return "index";		
	}
	


}
