Skip to content

Instantly share code, notes, and snippets.

@apuravchauhan
Created November 24, 2017 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apuravchauhan/cb4d02315571c97885fcb3e4a97eaa9c to your computer and use it in GitHub Desktop.
Save apuravchauhan/cb4d02315571c97885fcb3e4a97eaa9c to your computer and use it in GitHub Desktop.
Sample URL exposed
package com.apuravchauhan.web.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
*
* @author apuravchauhan
*
*/
@Controller
public class HelloController {
@RequestMapping("/")
public ModelAndView sayHello(HttpServletRequest request) {
request.getSession(true);
ModelAndView model = new ModelAndView("hello");
model.addObject("msg", "Apurav Chauhan");
return model;
}
@RequestMapping("/redirect")
public String redirect() {
return "redirect:/";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment