I would like to write whole controller to work with entity. I would like to declare the id of entity on class level and use it on each method. Here is the controller class:
@Controller
@RequestMapping(value="/job/{j_id}/instance")
public class JobController extends GenericController {
private final String htmlDir = "job/";
@RequestMapping(value="{i_id}/open", method=RequestMethod.GET)
public ModelAndView open(@PathVariable Long instance_id) {
ModelAndView result = new ModelAndView(htmlDir + "instance");
result.addObject("instance_id", instance_id);
Here I would like to use variable j_id
from @RequestMapping
return result;
}
}
Can I achive this? Please help. Give me some code snippest please.