-
Aug 24th, 2010, 10:12 AM
#1
JSTL issue !
Hi Techies,
I am using spring annotations, the following is controller,
=========================
@Controller
@RequestMapping("/contactmanagement.html")
@SessionAttributes("details")
public class ContactManagementSystem {
private AppoinmentDAO appoinmentDAO;
@Autowired
public void setAppoinmentDAO(AppoinmentDAO appoinmentDAO) {
this.appoinmentDAO = appoinmentDAO;
}
@ModelAttribute("customerList")
public List<CustomerBean> customerDetailList() {
return appoinmentDAO.getCustomers();
}
@RequestMapping(method = RequestMethod.GET)
public String showContactForm(@ModelAttribute("contact") CustomerBean contact , ModelMap model) {
System.out.println("Am in Get Method !!");
model.addAttribute("contact", contact);
return "temp";
}
@RequestMapping(method = RequestMethod.POST)
public String onSubmit(@ModelAttribute("bean") CustomerBean bean) {
return "contact";
}
=============
and my jsp is :
=====================
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
</head>
<body>
<c:forEach var="temp" items="${customerList}">
<c:out value="${temp}"></c:out>
<c:out value="${temp.firstName}"></c:out>
</c:forEach>
</body>
</html>
============
I am getting the following O/P
com.XXXX.bean.CustomerBean@f77511
Naveen
com.XXXX.bean.CustomerBean@131f2b4
// The Value is not displaying
com.XXXX.bean.CustomerBean@ea3932
// The Value is not displaying
============
Actually am setting the Bean Attribute , whiler iterate the Last list name only am getting and the rest of the name is not displaying.
Any idea and suggestions welcome please,
-----------------
Thanks & Regards,
Thangavel L Nathan.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules