<h1>**In my project i am using Struts2, Spring2.5 and JPA(Hibernate)**<h2>
my "**EmployaaDaoJpa**"
Query query = entitymanager.createQuery("SELECT e.employeeName FROM Employee e");
List<
String> lstEmployee = query.getResultList();
- using this i am getting all the employee names. and in my action class i will get all the states, both are declared in my VO (I implemented ModelDriven)
List<String> lstEmployees;
String yourEmployee;
in the action class i will initialize the lstStates like
lstEmployees = employeeDao.getAllEmployees();
and in my
jsp
<s:select headerKey="" headerValue="--- Select ---" list="states" name="yourEmployee" key="addEmployee.yourEmployee" required="true" cssClass="input"></s:select>
when i run this with server then it will generate html code, in that i am getting
value of the list and name of the list as same, like,
<select name="yourEmployee" id="AddEmployeeAction_yourEmployee" class="input">
<option value="">--- Select ---</option>
<option value="XYZ">XYZ</option> //(Here value and name are same "XYZ"
<option value="ABC">ABC</option> //(Here value and name are same "ABC"
<option value="MJJ">MJJ</option> //(Here value and name are same "MJJ"
</select>
my problem is that, i wanna set employeeId as value and employeeName as name..
**So, if anyone know about this please help me...**
**Thanks in advance....**