I am working on a spring 3.1 app. I have a
jsp where I display a list of projects (displayed as links) - Project name is displayed which is one of the fields in Project entity.
On click of any of these projects, I need to fetch that project name in the controller(If possible the whole Project entity) and display fruther details of same project.
Problem is, I am not able to retrieve the Project name that is clicked on by the user:
Below is the snippet from my JSP and controller where I am trying to fetch:
JSP:
<form action="viewDashboard" class="simple_form" id="tProject" name="tProject" method="post">
<c:forEach items="${projList}" var="tProject" >
<tr> <td>
<a href="./viewDashboard" id="tProject.prjName" name="tProject.prjName" value="${tProject.prjName}"> ${tProject.prjName} </a>
</td> </tr>
</c:forEach>
CONTROLLER:
@Controller
@RequestMapping("/login/viewDashboard")
public class DashBoardController {
@Autowired
DashBoardService dashBoardService;
@RequestMapping(method = RequestMethod.GET)
// @ModelAttribute("projList")
public
String displayDashboardTProject tProject, BindingResult bindingResult) {
System.out.println("Proj Name:" + tProject.getPrjName()); //This displayes null now
return "Dashboard";
}
}
Can someone please point what is wrong here or if Iam completly not making any sense !!!