indone
Jul 17th, 2007, 12:31 PM
Hi Guys,
Have a quick question for multiactioncontroller. I have a collection
where i am displaying list of objects for the radio options.
is there anyway i can get the selected entity object alone?
Here is code..and i am able to display the collection but want to achieve
to retrieve the selected object.
<c:forEach var="listingdos"
items="${listingdos}">
<spring:bind path="listingdos.entity">
<input type="radio" name="<c:out value="${status.expression}"/>"
value="${status.value}"> <c:out value="${listingdos.content.businessName}," />
</spring:bind>
</c:forEach>
for controller :
public ModelAndView matchHandler(HttpServletRequest request,
HttpServletResponse response ,Object entity) throws Exception {
super.bind(request,entity);
try {
// TODO Replace with real listing id
Identifier listingId = (Identifier)entity;
System.out.println("binding the values "+ listingId);
System.out.println("binding the values index"+ listingId.getId());
// listingId.setId(selectedListingID);
Advertisement listingObj =
advertisementService.getAdvertisementDetails(listi ngId, ProductType.Listing);
userSession.setSelectedAdvertisement(listingObj);
} catch (Exception e) {
logger.error("error inside matchHandler", e);
throw e;
}
RedirectView view = new RedirectView(
"/listing.do?REQUESTFROM=continue&_flowId=businessprofile-flow",
true);
ModelAndView mav = new ModelAndView(view);
return mav;
Have a quick question for multiactioncontroller. I have a collection
where i am displaying list of objects for the radio options.
is there anyway i can get the selected entity object alone?
Here is code..and i am able to display the collection but want to achieve
to retrieve the selected object.
<c:forEach var="listingdos"
items="${listingdos}">
<spring:bind path="listingdos.entity">
<input type="radio" name="<c:out value="${status.expression}"/>"
value="${status.value}"> <c:out value="${listingdos.content.businessName}," />
</spring:bind>
</c:forEach>
for controller :
public ModelAndView matchHandler(HttpServletRequest request,
HttpServletResponse response ,Object entity) throws Exception {
super.bind(request,entity);
try {
// TODO Replace with real listing id
Identifier listingId = (Identifier)entity;
System.out.println("binding the values "+ listingId);
System.out.println("binding the values index"+ listingId.getId());
// listingId.setId(selectedListingID);
Advertisement listingObj =
advertisementService.getAdvertisementDetails(listi ngId, ProductType.Listing);
userSession.setSelectedAdvertisement(listingObj);
} catch (Exception e) {
logger.error("error inside matchHandler", e);
throw e;
}
RedirectView view = new RedirectView(
"/listing.do?REQUESTFROM=continue&_flowId=businessprofile-flow",
true);
ModelAndView mav = new ModelAndView(view);
return mav;