I have a Spring MVC (3) Controller and I trying to put in the annotations but failed Heres my code outline
@Controller
public class SpringController{
@RequestMapping("/welcome")
public String myHandler(@RequestParam("id" String id)){
//My RequestParm is able to do the job of request.getParameter("id")
HttpSession session = request.getSession();
session.setAttribute("name","Mike") ;
return "myFirstJsp";
}
@RequestMapping("/process")
public String processHandler(@RequestParam("processId" String processId)){
//do stuff
String someName = session.getAttribute("name");
return "result";
}
}
Just for the sake of session object I have to declare HttpServletRequest and HttpSession. Is there anyway we can have a solution with @nnotations.
Thanks!