Hi , I'm fairly new to Spring MVC .I'd like to bind 3 radio buttons in my jsp to some boolean values .Here's what I have and tried :
My Command class
==============
Code:public class MyCommand extends BaseCommand { private MyVO filter; public MyVO getFilter() { return filter; } public void setFilter(MyVO filter) { this.filter = filter; } }
My VO class
=========
Code:public class MyVO implements ValueObject { private boolean createdBy = false; private boolean createdFor = false; private boolean participantOn = true; public boolean getCreatedBy() { return createdBy; } public void setCreatedBy(boolean createdBy) { this.createdBy = createdBy; } public boolean getCreatedFor() { return createdFor; } public void setCreatedFor(boolean createdFor) { this.createdFor = createdFor; } public boolean getParticipantOn() { return participantOn; } public void setParticipantOn(boolean participantOn) { this.participantOn = participantOn; } }
and then in jsp i have the following :
============================
Code:<spring:bind path="myCommand.filter"> <input type="radio" name="radios" value="${status.value}" /> Created by <br> <input type="radio" name="radios" value="${status.value}"/> Created for <br> <input type="radio" name="radios" value="${status.value}"/> Participant on </spring:bind>
How do I correctly wire the radio buttons to map to the boolean variables in my VO class , MyVO , i.e
Thank youCode:private boolean createdBy = false; private boolean createdFor = false; private boolean participantOn = true;


Reply With Quote