views:

585

answers:

1

Using Apache Struts, I would like to bind a dynamic value to the html:checkbox value.

For instance I want to get userid in the form while submit the action.

Now

<html:checkbox property="userCheck" value="${searchedUsers.userId}"></html:checkbox>

so I just bind my userId value in the value attribute of check box.

searchedUsers is an arraylist which consist of user details include userId.

While submit the form I got $searchedUser.userId that is the value as it is.

A: 

To bind that value we need to add appserv-jstl.jar in our WEB-INF/lib folder.

Then include following code in our page

'<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>'

Now it will work.